validate method
Returns ValidationMessages.requiredField
if the value is empty, otherwise null
.
Implementation
@override
/// Returns `ValidationMessages.requiredField` if the value is empty, otherwise `null`.
String? validate(String value) {
if (value.trim().isEmpty) {
return ValidationMessages.requiredField;
}
return null;
}