customRegexFormatter static method
customRegexFormatter allows input based on a custom regular expression.
Implementation
static List<TextInputFormatter> customRegexFormatter(String pattern) {
return [
FilteringTextInputFormatter.allow(RegExp(pattern)),
];
}