TimelineCalendar constructor
TimelineCalendar({
- GlobalKey<
State< ? key,StatefulWidget> > - CalendarDateTime? dateTime,
- CalendarOptions? calendarOptions,
- DayOptions? dayOptions,
- HeaderOptions? headerOptions,
- CalendarChangeCallback? onChangeDateTime,
- CalendarChangeCallback? onMonthChanged,
- CalendarChangeCallback? onDateTimeReset,
- VoidCallback? onInit,
- CalendarChangeCallback? onYearChanged,
- ViewTypeChangeCallback? onChangeViewType,
- required dynamic calendarType,
- dynamic calendarLanguage,
Implementation
TimelineCalendar({
GlobalKey? key,
CalendarDateTime? dateTime,
this.calendarOptions,
this.dayOptions,
this.headerOptions,
this.onChangeDateTime,
this.onMonthChanged,
this.onDateTimeReset,
this.onInit,
this.onYearChanged,
this.onChangeViewType,
required calendarType,
calendarLanguage,
}) : super(key: key) {
calendarOptions ??= CalendarOptions();
headerOptions ??= HeaderOptions();
dayOptions ??= DayOptions();
TimelineCalendar.calendarType = calendarType ?? CalendarType.GREGORIAN;
TimelineCalendar.calendarProvider = createInstance();
if (key?.currentContext == null ||
calendarType != TimelineCalendar.calendarType) {
TimelineCalendar.dateTime = dateTime ?? calendarProvider.getDateTime();
}
TimelineCalendar.calendarType = calendarType ?? CalendarType.GREGORIAN;
TimelineCalendar.calendarLanguage = calendarLanguage ?? 'en';
}