minLength static method
Validation rule to check the minimum length of a string.
Returns message if value is shorter than length.
Implementation
static ValidationRule minLength(int length, {String? message}) {
return ValidationRule(
(value) => value != null && value.length >= length ? null : '',
message ?? 'Must be at least $length characters long',
);
}