TimelineCalendar constructor

TimelineCalendar({
  1. GlobalKey<State<StatefulWidget>>? key,
  2. CalendarDateTime? dateTime,
  3. CalendarOptions? calendarOptions,
  4. DayOptions? dayOptions,
  5. HeaderOptions? headerOptions,
  6. CalendarChangeCallback? onChangeDateTime,
  7. CalendarChangeCallback? onMonthChanged,
  8. CalendarChangeCallback? onDateTimeReset,
  9. VoidCallback? onInit,
  10. CalendarChangeCallback? onYearChanged,
  11. ViewTypeChangeCallback? onChangeViewType,
  12. required dynamic calendarType,
  13. 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';
}