toRange method
Implementation
@override
RangeCalendarValue toRange() {
assert(dates.isNotEmpty, 'Cannot convert empty list to range');
DateTime min = dates
.reduce((value, element) => value.isBefore(element) ? value : element);
DateTime max = dates
.reduce((value, element) => value.isAfter(element) ? value : element);
return CalendarValue.range(min, max);
}