rangeContains function

bool rangeContains(
  1. DateRange range,
  2. Date? date
)

Whether or not date is inside range.

Inclusive, and treats a null range.start or range.end as unbounded.

Implementation

bool rangeContains(DateRange range, Date? date) =>
    (range.start == null || date! >= range.start) &&
    (range.end == null || date! <= range.end);