isEmailValid method

bool isEmailValid(
  1. String email
)

Implementation

bool isEmailValid(String email) {
  // Regular expression for a valid email address
  final RegExp emailRegex = RegExp(
    r'^[\w-\.]+@([\w-]+\.)+[\w-+]{2,4}$',
    caseSensitive: false,
    multiLine: false,
  );
  return emailRegex.hasMatch(email);
}