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