maxLength static method
String must have maximum length.
Implementation
static NiceValidationRule maxLength(int max, {String? message}) => (value) {
if (value is String && value.length > max) {
return message ?? 'Maximum $max characters';
}
return null;
};