maxLength static method
Validates maximum length
Implementation
static String? Function(String?) maxLength(int maxLength, {String? message}) {
return (String? value) {
if (value != null && value.length > maxLength) {
return message ??
_defaultMessages['maxLength']!.replaceAll(
'{maxLength}',
maxLength.toString(),
);
}
return null;
};
}