minLengthValidator function
Validates that the value meets minimum length requirement.
Implementation
String? Function(String?) minLengthValidator(int minLength, String fieldName) {
return (value) {
if (value == null || value.length < minLength) {
return '$fieldName must be at least $minLength characters';
}
return null;
};
}