Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions lib/email_validator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ class EmailValidator {

_index++;

while (
_index < text.length && _isDomain(text[_index], allowInternational)) {
while (_index < text.length &&
_isDomain(text[_index], allowInternational)) {
_index++;
}

Expand All @@ -135,7 +135,10 @@ class EmailValidator {
// Skips checking of domain if domainType is numeric and returns false
// Otherwise, return true
static bool _skipDomain(
String text, bool allowTopLevelDomains, bool allowInternational) {
String text,
bool allowTopLevelDomains,
bool allowInternational,
) {
if (!_skipSubDomain(text, allowInternational)) {
return false;
}
Expand Down Expand Up @@ -328,8 +331,11 @@ class EmailValidator {
/// If [allowInternational] is `true`, then the validator
/// will use the newer International Email standards for validating
/// the email address.
static bool validate(String email,
[bool allowTopLevelDomains = false, bool allowInternational = true]) {
static bool validate(
String email, [
bool allowTopLevelDomains = false,
bool allowInternational = true,
]) {
_index = 0;

if (email.isEmpty || email.length >= 255) {
Expand Down
Loading