BlocxDateRangeValidator constructor

BlocxDateRangeValidator({
  1. required DateTime minDate,
  2. required DateTime maxDate,
  3. Duration? duration,
})

Creates a validator that enforces the date to be within minDate and maxDate.

Implementation

BlocxDateRangeValidator({required this.minDate, required this.maxDate, super.duration})
  : assert(
      maxDate.isAfter(minDate) || maxDate.isAtSameMomentAs(minDate),
      'maxDate must be after or equal to minDate',
    );