minLength static method
Minimum length
Implementation
static String? Function(String?) minLength(int length, [String? message]) {
return (value) {
if (value == null || value.isEmpty) return null;
if (value.length < length) {
return message ?? 'Must be at least $length characters';
}
return null;
};
}