customRegexFormatter static method

List<TextInputFormatter> customRegexFormatter(
  1. String pattern
)

customRegexFormatter allows input based on a custom regular expression.

Implementation

static List<TextInputFormatter> customRegexFormatter(String pattern) {
  return [
    FilteringTextInputFormatter.allow(RegExp(pattern)),
  ];
}