validateEmailPattern static method

bool validateEmailPattern(
  1. String value
)

Implementation

static bool validateEmailPattern(String value){
  final pattern = RegExp(r'^[A-Z0-9a-z._%+-]+@[A-Za-z0-9-]+\.[A-Za-z.-]{2,64}');
  final matches = pattern.allMatches(value);
  for (Match match in matches) {
    if (match.start == 0 && match.end == value.length) {
      return true;
    }
  }
  return false;
}