validate method

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

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