validate method
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;
}