@@ -16,33 +16,19 @@ class EmailValidator {
16
16
static const String _atomCharacters = "!#\$ %&'*+-/=?^_`{|}~" ;
17
17
static SubdomainType _domainType = SubdomainType .None ;
18
18
19
- // Returns true if the first letter in string c has a 16-bit UTF-16 code unit
20
- // greater than or equal to 48 and less than or equal to 57
21
- // otherwise return false
22
19
static bool _isDigit (String c) {
23
20
return c.codeUnitAt (0 ) >= 48 && c.codeUnitAt (0 ) <= 57 ;
24
21
}
25
22
26
- // Returns true if the first letter in string c has a 16-bit UTF-16 code unit
27
- // greater than or equal to 65 and less than or equal to 90 (capital letters)
28
- // or greater than or equal to 97 and less than or equal to 122 (lowercase letters)
29
- // otherwise return false
30
23
static bool _isLetter (String c) {
31
24
return (c.codeUnitAt (0 ) >= 65 && c.codeUnitAt (0 ) <= 90 ) ||
32
25
(c.codeUnitAt (0 ) >= 97 && c.codeUnitAt (0 ) <= 122 );
33
26
}
34
27
35
- // Returns true if calling isLetter or isDigit with the same string returns true
36
- // Only returns false if both isLetter and isDigit return false
37
28
static bool _isLetterOrDigit (String c) {
38
29
return _isLetter (c) || _isDigit (c);
39
30
}
40
31
41
- // Returns value of allowInternational if the first letter in the string c isnt a
42
- // number or letter or special character otherwise
43
- // return the result of _isLetterOrDigit or _atomCharacters.contains(c)
44
- // which only returns false if both _isLetterOrDigit and _atomCharacters.contains(c)
45
- // returns false
46
32
static bool _isAtom (String c, bool allowInternational) {
47
33
return c.codeUnitAt (0 ) < 128
48
34
? _isLetterOrDigit (c) || _atomCharacters.contains (c)
0 commit comments