max<T> static method

FormFieldValidator<T> max<T>(
  1. num max, {
  2. bool inclusive = true,
  3. String? errorText,
  4. bool checkNullOrEmpty = true,
})

FormFieldValidator that requires the field's value to be less than (or equal) to the provided number.

Parameters:

  • max The maximum value to compare.
  • inclusive Whether the comparison is inclusive (default: true).
  • errorText The error message when the value is invalid.
  • checkNullOrEmpty Whether to check for null or empty values.

Implementation

static FormFieldValidator<T> max<T>(
  num max, {
  bool inclusive = true,
  String? errorText,
  bool checkNullOrEmpty = true,
}) => MaxValidator<T>(
  max,
  inclusive: inclusive,
  errorText: errorText,
  checkNullOrEmpty: checkNullOrEmpty,
).validate;