isEmail method

bool isEmail()

Check if a string is a valid email address.

Implementation

bool isEmail() {
  if (this == null) {
    throw ArgumentError('string: $this');
  }
  if (this!.isEmpty) {
    return false;
  }
  return RegExp(r'^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$')
      .hasMatch(this!);
}