isEmail static method

bool isEmail(
  1. String str
)

判断是否为邮箱格式 Check if it is email format

Implementation

static bool isEmail(String str) {
  return RegExp(r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$").hasMatch(str);
}