email static method

FormFieldValidator<String> email([
  1. String message = 'Invalid email'
])

Fails when a non-empty value isn't a valid email. Empty passes — combine with required to also require a value.

Implementation

static FormFieldValidator<String> email([String message = 'Invalid email']) =>
    (value) =>
        (value == null || value.isEmpty || WtSecurity.isValidEmail(value))
            ? null
            : message;