lessThan static method
Implementation
static Validator lessThan(double val, [String? text]) {
return (String? value) {
if (value == null || value.isEmpty) {
return "Field cannot be empty.";
}
return (double.parse(value.replaceAll(',', '')) > val)
? (text ?? "The value should not be greater than ${val.formatAmount}")
: null;
};
}