setDisabledDates method

void setDisabledDates({
  1. List<DateTime>? disabledList,
  2. List<Map<String, DateTime?>>? disabledRangeList,
})

Implementation

void setDisabledDates(
    {List<DateTime>? disabledList,
    List<Map<String, DateTime?>>? disabledRangeList}) {
  if (disabledList != null) {
    for (var disabledDay in disabledList) {
      if (isSameYearMonth(disabledDay)) {
        setCurrentMonth(disabledDay, SelectType.disabled);
      }
    }
  }
  if (disabledRangeList != null) {
    for (var rangeMap in disabledRangeList) {
      if (rangeMap['start'] != null && rangeMap['end'] != null) {
        DateTime? currentMonthStartDate =
            rangeMap['start']!.setDisabledStartDate(calendarInfo: this);
        DateTime? currentMonthEndDate =
            rangeMap['end']!.setDisabledEndDate(calendarInfo: this);
        if (currentMonthStartDate != null && currentMonthEndDate != null) {
          setCurrentMonthRange(
              startDt: currentMonthStartDate,
              endDt: currentMonthEndDate,
              type: SelectType.disabled);
        }
      }
    }
  }
}