enumerateRange function

Iterable<Date> enumerateRange(
  1. DateRange? range
)

Enumerates all dates from range.start to range.end, inclusive.

Returns an empty iterator when range is null. Throws ArgumentError when range is unbounded on either side. See enumerateDates for more details.

Implementation

Iterable<Date> enumerateRange(DateRange? range) {
  if (range == null) {
    return [];
  }
  if (range.start == null || range.end == null) {
    throw ArgumentError(
        'Cannot call enumerateRange with a range with a null start or end.');
  }
  return enumerateDates(range.start!, range.end);
}