email static method

FormFieldValidator<String> email({
  1. RegExp? regex,
  2. String? errorText,
  3. bool checkNullOrEmpty = true,
})

FormFieldValidator that requires the field's value to be a valid email address.

Parameters:

  • regex The regex pattern to match.
  • errorText The error message when the email is invalid.
  • checkNullOrEmpty Whether 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;