RangeValidator<T> constructor

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

Constructor for the range validator.

Implementation

RangeValidator(
  this.min,
  this.max, {
  this.inclusive = true,

  /// {@macro base_validator_error_text}
  super.errorText,

  /// {@macro base_validator_null_check}
  super.checkNullOrEmpty,
}) : _minValidator = MinValidator<T>(
       min,
       inclusive: inclusive,
       errorText: errorText,
       checkNullOrEmpty: checkNullOrEmpty,
     ),
     _maxValidator = MaxValidator<T>(
       max,
       inclusive: inclusive,
       errorText: errorText,
       checkNullOrEmpty: checkNullOrEmpty,
     ),
     _minLengthValidator = MinLengthValidator<T>(
       min.toInt(),
       errorText: errorText,
       checkNullOrEmpty: checkNullOrEmpty,
     ),
     _maxLengthValidator = MaxLengthValidator<T>(
       max.toInt(),
       errorText: errorText,
       checkNullOrEmpty: checkNullOrEmpty,
     );