minLength<T> static method
Implementation
static FormFieldValidator<T> minLength<T>(int minLength, {
bool allowEmpty = false,
String? errorText,
}) {
assert(minLength > 0);
return (T? valueCandidate) {
assert(valueCandidate is String || valueCandidate is Iterable || valueCandidate == null);
var valueLength = 0;
if (valueCandidate is String) valueLength = valueCandidate.length;
if (valueCandidate is Iterable) valueLength = valueCandidate.length;
return valueLength < minLength && (!allowEmpty || valueLength > 0)
? errorText ?? BasicFormValidatorMessageError().minLength!(minLength)
: null;
};
}