max<T> static method
Implementation
static FormFieldValidator<T> max<T>(num max, {
bool inclusive = true,
String? errorText,
}) {
return (T? valueCandidate) {
if (valueCandidate != null) {
assert(valueCandidate is num || valueCandidate is String);
final number = BasicNumberTransformer.currencyToNumber(valueCandidate.toString());
if (number != null && (inclusive ? number > max : number >= max)) {
return errorText ?? BasicFormValidatorMessageError().max!('$max');
}
}
return null;
};
}