email static method
Implementation
static ValidationRule email([String message = 'Enter a valid email address']) {
return ValidationRule((value) {
if (value == null || value.isEmpty) return null;
final regex = RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$');
return regex.hasMatch(value) ? null : message;
});
}