Flutter – FilteringTextInputFormatter.allow is not allowing more than 2 consecutive dots in the TextField

  Kiến thức lập trình

With the below code, if we are entering 3 consecutive dots. those entered 2 dots got removed as well.

TextFormField(
              autocorrect: false,
              enableSuggestions: false,
              inputFormatters: [
              FilteringTextInputFormatter.allow(RegExp("[a-zA-Z0-9@,#.]")),
              LengthLimitingTextInputFormatter(20)],
            )

Example:
User entering input: Abc…

What Actually TextField shows in UI: Abc

Expected: Abc…

Note: Faced in iOS, Not tested in Android.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT