email method
A email validator.
Implementation
ValidatorFn<String> email([String? message]) {
return (String? value, BuildContext context) {
if (value == null || value.isEmpty) {
return this.call(value, context);
}
if (!_emailPattern.hasMatch(value)) {
return message ?? HookFormScope.of(context).invalidEmail;
}
return this.call(value, context);
};
}