email static method
FormFieldValidator that requires the field's value to be a valid email address.
Implementation
static FormFieldValidator email({
String errorText = "This field requires a valid email address.",
}) {
return (valueCandidate) {
if (valueCandidate?.isNotEmpty == true) {
if (!isEmail(valueCandidate as String)) {
return errorText;
}
}
return null;
};
}