isValidEmail static method

bool isValidEmail(
  1. String email
)

Validates if the given string is a valid email address.

Implementation

static bool isValidEmail(String email) {
  final regex = RegExp(r'^[^@\s]+@[^@\s]+\.[^@\s]+\$');
  return regex.hasMatch(email);
}