range<T> static method

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

FormFieldValidator that requires the field's value to be within a certain range.

Parameters:

  • min The minimum value should be greater than or equal to.
  • max The maximum value should be less than or equal to.
  • inclusive Whether the range is inclusive (default: true).
  • errorText The error message when the value is not in the range.
  • checkNullOrEmpty Whether to check for null or empty values.

Implementation

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