0

I'm beginner to flutter any one have some solution for the when im trying to type First Name , i wanna do disable typing keyboard space, comma , any idea how to do that?

I tried to used this formatter inputFormatters: [WhitelistingTextInputFormatter(RegExp(r"[A-Z0-9]+"))],

formatter not support got a following error message

WhitelistingTextInputFormatter' is deprecated and shouldn't be used. Use FilteringTextInputFormatter.allow instead. This feature was deprecated after v1.20.0-1.0.pre..

code here

 TextField(
                              textInputAction: TextInputAction.done,
                              keyboardType: TextInputType.text,
                              controller: fNameController,
                              style: TextStyle(color: Colors.black),
                              decoration: InputDecoration(
                                isDense: true,
                                contentPadding: EdgeInsets.only(left: 14,top: 12,bottom: 12),
                                border: OutlineInputBorder(
                                  borderRadius: BorderRadius.circular(8.0),
                                  borderSide: BorderSide.none,
                                ),
                                filled: true,
                                fillColor: Color(0xFFE1E8F7),
                                hintText: "",
                              ),
                            ),
core114
  • 5,155
  • 16
  • 92
  • 189

0 Answers0