hasNumericChars static method
FormFieldValidator that requires the field's value to contain a minimum number of numeric characters.
Parameters:
atLeast
The minimum number of numeric characters (default: 1).regex
The regex pattern to match.errorText
The error message when the value does not contain the required number of numeric characters.checkNullOrEmpty
Whether to check for null or empty values.
This regex matches any character that is a digit (0-9).
- It includes all numeric digits.
- It can be used to find numeric characters.
Examples: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Implementation
static FormFieldValidator<String> hasNumericChars({
int atLeast = 1,
RegExp? regex,
String? errorText,
bool checkNullOrEmpty = true,
}) => HasNumericCharsValidator(
atLeast: atLeast,
regex: regex,
errorText: errorText,
checkNullOrEmpty: checkNullOrEmpty,
).validate;