email static method

String? email(
  1. String? value
)

Validate email address

Implementation

static String? email(String? value) {
  if (value == null || value.isEmpty) {
    return 'Email is required';
  }

  if (!RegexPatterns.email.hasMatch(value)) {
    return 'Please enter a valid email address';
  }

  return null;
}