email static method
✅ Email Validator
Implementation
static String? email(
String? value, {
String errorMsg = 'Enter a valid email',
}) {
if (value == null || value.isEmpty) return 'Email is required';
final emailRegex = RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$');
return emailRegex.hasMatch(value) ? null : errorMsg;
}