XBCalendarYear constructor

XBCalendarYear({
  1. required int year,
  2. required DateTime minDateTime,
  3. required DateTime maxDateTime,
  4. required DateTime? minEnableDateTime,
  5. required DateTime? maxEnableDateTime,
  6. required List<DateTime>? markDates,
})

Implementation

XBCalendarYear(
    {required this.year,
    required DateTime minDateTime,
    required DateTime maxDateTime,
    required DateTime? minEnableDateTime,
    required DateTime? maxEnableDateTime,
    required List<DateTime>? markDates}) {
  for (int i = 1; i <= 12; i++) {
    if ((year == minDateTime.year && i < minDateTime.month) ||
        (year == maxDateTime.year && i > maxDateTime.month)) continue;
    _months.add(XBCalendarMonth(
        year: year,
        month: i,
        minEnableDateTime: minEnableDateTime,
        maxEnableDateTime: maxEnableDateTime,
        markDates: markDates));
  }
}