setSelectedBtwDates method

void setSelectedBtwDates({
  1. required DatesRange datesRange,
  2. List<DateTime>? disabledList,
  3. List<Map<String, DateTime?>>? disabledRangeList,
})

Implementation

void setSelectedBtwDates(
    {required DatesRange datesRange,
    List<DateTime>? disabledList,
    List<Map<String, DateTime?>>? disabledRangeList}) {
  if (datesRange.start != null && datesRange.end != null) {
    datesRange.start!.getBtwDates(end: datesRange.end!).forEach((btwDate) {
      setCurrentMonth(btwDate, SelectType.between);
    });
    setCurrentMonth(datesRange.start!, SelectType.start);
    setCurrentMonth(datesRange.end!, SelectType.end);
  } else if (datesRange.start != null) {
    if (datesRange.start!.year == year && datesRange.start!.month == month) {
      dates
          .singleWhere((date) => date.date == datesRange.start!.day)
          .isSelected = SelectType.start;
    }
  }
  setDisabledDates(
      disabledList: disabledList, disabledRangeList: disabledRangeList);
}