noWhitespaceFormatter static method

List<TextInputFormatter> noWhitespaceFormatter()

noWhitespaceFormatter prevents all whitespace characters.

Implementation

static List<TextInputFormatter> noWhitespaceFormatter() {
  return [
    FilteringTextInputFormatter.deny(RegExp(r'\s')),
  ];
}