isEmail property

bool isEmail

Check if the string is a valid email address

Implementation

bool get isEmail {
  final emailRegex = RegExp(r'^[\w\.-]+@[a-zA-Z\d\.-]+\.[a-zA-Z]{2,}$');
  return emailRegex.hasMatch(this);
}