isEmail method

bool isEmail()

Checks if the string is a valid email.

Implementation

bool isEmail() {
  final emailRegex = RegExp(r'^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$');
  return emailRegex.hasMatch(this);
}