validate method
- String? value
override
Validates the value and returns an error string if it fails,
or null if it passes.
Implementation
@override
String? validate(String? value) {
if (value == null || value.isEmpty) return null;
final regex = RegExp(r'^[^@]+@[^@]+\.[^@]+$');
if (!regex.hasMatch(value)) {
return message;
}
return null;
}