initializeMonth method
void
initializeMonth(})
Initializes the month and other settings for the calendar.
Takes the selected month, start day, a list of custom marked dates, and a flag for range selection. Also, an optional callback is provided to handle user-picked dates.
Implementation
void initializeMonth(
DateTime selectedMonth,
Day startDay,
List<MarkedDaysModel>? customList,
bool isRange, {
void Function(List<DateTime>)? onUserPicked,
}) {
_selectedMonth = selectedMonth;
final firstDay = DateTime(selectedMonth.year, selectedMonth.month, 1);
startedDay = startDay;
_startOffset = (firstDay.weekday % 7);
_totalDays = DateUtils.getDaysInMonth(
selectedMonth.year,
selectedMonth.month,
);
isRangeSelection = isRange;
_onUserPickedCallback = onUserPicked;
selectedDaysList = customList ?? [];
_userPicked = null;
notifyListeners();
}