mirror of https://github.com/flutter/samples.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
254 B
11 lines
254 B
2 years ago
|
/// Returns true if the given String is a valid email address.
|
||
|
bool isValidEmail(String text) {
|
||
|
return RegExp(
|
||
|
r'(?<name>[a-zA-Z0-9]+)'
|
||
|
r'@'
|
||
|
r'(?<domain>[a-zA-Z0-9]+)'
|
||
|
r'\.'
|
||
|
r'(?<topLevelDomain>[a-zA-Z0-9]+)',
|
||
|
).hasMatch(text);
|
||
|
}
|