email static method
FormFieldValidator that requires the field's value to be a valid email address.
Parameters:
regexThe regex pattern to match.errorTextThe error message when the email is invalid.checkNullOrEmptyWhether to check for null or empty values.
The default regex matches an email address.
- It allows various characters, including letters, digits, and special characters.
- It supports international characters.
- It checks for the presence of an "@" symbol followed by a valid domain name.
Examples: user@example.com, user.name+tag@example.co.uk
Implementation
static FormFieldValidator<String> email({
RegExp? regex,
String? errorText,
bool checkNullOrEmpty = true,
}) => EmailValidator(
regex: regex,
errorText: errorText,
checkNullOrEmpty: checkNullOrEmpty,
).validate;