validate method
Returns ValidationMessages.invalidEmail
if the value is not a valid email, otherwise null
.
Implementation
@override
/// Returns `ValidationMessages.invalidEmail` if the value is not a valid email, otherwise `null`.
String? validate(String value) {
if (!RegExp(ValidationPatterns.emailPattern).hasMatch(value)) {
return ValidationMessages.invalidEmail;
}
return null;
}