custom<T> static method
Validator<T>
custom<T>(
- bool validate(
- T value,
- ValidationContext context
- String error = '',
Implementation
static Validator<T> custom<T>(
bool Function(T value, ValidationContext context) validate, {
String error = '',
}) =>
(value, context) {
if (validate(value, context)) return (true, null);
return (false, error);
};