minWords static method
Validates minimum word count.
Implementation
static String? minWords(String? value, int min, {String? fieldName}) {
if (value == null || value.isEmpty) {
return null;
}
final wordCount = _countWords(value);
if (wordCount < min) {
return '${fieldName ?? "This field"} must contain at least $min words.';
}
return null;
}