lessThan static method

Validator lessThan(
  1. double val, [
  2. String? text
])

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;
  };
}