email method

EzValidator<T> email([
  1. String? message
])

Checks if the value is an email address message is the message to return if the validation fails

Implementation

EzValidator<T> email([String? message]) => addValidation((v, [_]) {
      if (v is String) {
        return emailRegExp.hasMatch(v)
            ? null
            : message ?? EzValidator.globalLocale.email(v, label);
      }
      return 'Invalid type for email validation';
    });