minLength static method
Returns a validator that enforces minimum length.
Implementation
static String? Function(String?) minLength(int n, {String? message}) {
return (value) {
if (value == null) return null;
if (value.length < n) {
return message ?? 'Must be at least $n characters';
}
return null;
};
}