validate method

  1. @override
String? validate(
  1. String value
)
override

Returns ValidationMessages.maxLength if the value is longer than the max length, otherwise null.

Implementation

@override
/// Returns `ValidationMessages.maxLength` if the value is longer than the max length, otherwise `null`.
String? validate(String value) {
  if (value.length > maxLength) {
    return ValidationMessages.maxLength(maxLength);
  }
  return null;
}