isAnEmail static method

String? isAnEmail(
  1. String? checkValue, {
  2. String? errorMessage,
})

Checks if checkValue can be matched by the regular expression emailRegExp

If checkValue is null or is not matched by emailRegExp the errorMessage will be returned if provided, otherwise the default error. Otherwise null is returned

Implementation

static String? isAnEmail(String? checkValue, {String? errorMessage}) {
  return matches(checkValue, emailRegExp,
      errorMessage: errorMessage ?? "Not a valid email");
}