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