isEmail static method

bool isEmail(
  1. String input
)

Implementation

static bool isEmail(String input) {
  String regexEmail =
      "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}\$";
  if (input.isEmpty) return false;
  return RegExp(regexEmail).hasMatch(input);
}