max method
A maximum length validator.
Implementation
ValidatorFn<String> max(int length, [String? message]) =>
(String? value, BuildContext context) {
if (value != null && value.length > length) {
return message ?? HookFormScope.of(context).maxLength(length);
}
return this.call(value, context);
};