DateRange constructor

DateRange(
  1. DateTime? start,
  2. DateTime? end, {
  3. bool startInclusive = true,
  4. bool endInclusive = false,
})

Creates a new DateRange instance.

The start and end parameters define the boundaries of the range. If start or end is null, it represents negative or positive infinity, respectively.

startInclusive determines whether the start date is included in the range. endInclusive determines whether the end date is included in the range.

The time part of the start and end dates is ignored, and only the date part is considered.

Implementation

DateRange(DateTime? start, DateTime? end, {super.startInclusive = true, super.endInclusive = false})
    : super(start == null ? null : DateTime.utc(start.year, start.month, start.day),
          end == null ? null : DateTime.utc(end.year, end.month, end.day));