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