Flutter show message when wrong character entered on the TextField

126 views Asked by At

I have TextField with InputFormatter filtering input:

TextField(
  onChanged: _onChangedNumber,
  inputFormatters: [
    UpperCaseTextFormatter(),
    FilteringTextInputFormatter.allow(
      RegExp(r'[ABCDEFabcdef0-9]+'),
    )
  ],
  controller: _numberController,
),

Is there any way to show some message when a not accepted character entered? (For now, when entered not accepted character, for instance, 'r', it is just ignored, I want to inform user 'You trying to enter the wrong character, enter from A-F')

0

There are 0 answers