EmailValidationConfig class final

Configuration options for email validation.

This class holds various limits and rules used by EmailValidator.

Annotations
  • @immutable

Constructors

EmailValidationConfig({int maxLength = 254, int maxLocalPartLength = 64, int maxDomainLength = 253, Set<String> disposableDomains = kDefaultDisposableDomains, Set<String> blockedDomains = const {}, bool rejectDisposable = false, bool matchSubdomains = true})
Creates a new EmailValidationConfig with optional overrides.
const
EmailValidationConfig.strict()
Creates a strict EmailValidationConfig that disallows disposable emails.
factory

Properties

blockedDomains → Set<String>
A collection of specific domains that are explicitly blocked.
final
disposableDomains → Set<String>
Domains treated as disposable when rejectDisposable is enabled.
final
hashCode → int
The hash code for this object.
no setteroverride
matchSubdomains → bool
When true, configured domains also match their subdomains.
final
maxDomainLength → int
The maximum allowed length for the domain part (after the '@').
final
maxLength → int
The maximum allowed length for the entire email string.
final
maxLocalPartLength → int
The maximum allowed length for the local part (before the '@').
final
rejectDisposable → bool
When true, emails from disposableDomains are rejected.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({int? maxLength, int? maxLocalPartLength, int? maxDomainLength, Set<String>? disposableDomains, Set<String>? blockedDomains, bool? rejectDisposable, bool? matchSubdomains}) → EmailValidationConfig
Returns a copy of this config with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override