emailValidator function
Validates whether the input value is a valid email address.
Implementation
String? emailValidator(String value) {
if (value.isEmpty || !value.isEmail) {
return 'Please enter a valid email address.';
}
return null;
}