tryValidate method
Validates the form field value
Implementation
@override
String? tryValidate() {
RegExp exp = RegExp(
r"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$",
caseSensitive: false);
if (!exp.hasMatch(value)) {
if (customMessage == null) {
return buildMessage(ValidatorStrings.email, attribute);
}
return customMessage;
}
return null;
}