noAlphabetsFormatter static method

List<TextInputFormatter> noAlphabetsFormatter()

noAlphabetsFormatter prevents alphabetic input.

Implementation

static List<TextInputFormatter> noAlphabetsFormatter() {
  return [
    FilteringTextInputFormatter.deny(RegExp(r'[a-zA-Z]')),
  ];
}