maxLength static method
Implementation
static String? maxLength(String? value, int maxLength, {String? errorMessage}) {
if (value != null && value.length > maxLength) {
return errorMessage ?? 'Maximum length is $maxLength characters';
}
return null;
}