maxWordsCount static method
FormFieldValidator that requires the word count of the field's value to be less than or equal to the provided maximum count.
Parameters:
maxWordsCount
The maximum word count.errorText
The error message when the word count is invalid.checkNullOrEmpty
Whether to check for null or empty values.
Implementation
static FormFieldValidator<String> maxWordsCount(
int maxWordsCount, {
String? errorText,
bool checkNullOrEmpty = true,
}) => MaxWordsCountValidator(
maxWordsCount,
errorText: errorText,
checkNullOrEmpty: checkNullOrEmpty,
).validate;