TableCalendarBase constructor

TableCalendarBase({
  1. Key? key,
  2. required DateTime firstDay,
  3. required DateTime lastDay,
  4. required DateTime focusedDay,
  5. CalendarFormat calendarFormat = CalendarFormat.month,
  6. DayBuilder? dowBuilder,
  7. required FocusedDayBuilder dayBuilder,
  8. double? dowHeight,
  9. required double rowHeight,
  10. bool sixWeekMonthsEnforced = false,
  11. bool dowVisible = true,
  12. DayBuilder? weekNumberBuilder,
  13. bool weekNumbersVisible = false,
  14. Decoration? dowDecoration,
  15. Decoration? rowDecoration,
  16. TableBorder? tableBorder,
  17. EdgeInsets? tablePadding,
  18. Duration formatAnimationDuration = const Duration(milliseconds: 200),
  19. Curve formatAnimationCurve = Curves.linear,
  20. bool pageAnimationEnabled = true,
  21. Duration pageAnimationDuration = const Duration(milliseconds: 300),
  22. Curve pageAnimationCurve = Curves.easeOut,
  23. StartingDayOfWeek startingDayOfWeek = StartingDayOfWeek.sunday,
  24. AvailableGestures availableGestures = AvailableGestures.all,
  25. SimpleSwipeConfig simpleSwipeConfig = const SimpleSwipeConfig(verticalThreshold: 25.0, swipeDetectionBehavior: SwipeDetectionBehavior.continuousDistinct),
  26. Map<CalendarFormat, String> availableCalendarFormats = const {CalendarFormat.month : 'Month', CalendarFormat.twoWeeks : '2 weeks', CalendarFormat.week : 'Week'},
  27. SwipeCallback? onVerticalSwipe,
  28. void onPageChanged(
    1. DateTime focusedDay
    )?,
  29. void onCalendarCreated(
    1. PageController pageController
    )?,
})

Implementation

TableCalendarBase({
  Key? key,
  required this.firstDay,
  required this.lastDay,
  required this.focusedDay,
  this.calendarFormat = CalendarFormat.month,
  this.dowBuilder,
  required this.dayBuilder,
  this.dowHeight,
  required this.rowHeight,
  this.sixWeekMonthsEnforced = false,
  this.dowVisible = true,
  this.weekNumberBuilder,
  this.weekNumbersVisible = false,
  this.dowDecoration,
  this.rowDecoration,
  this.tableBorder,
  this.tablePadding,
  this.formatAnimationDuration = const Duration(milliseconds: 200),
  this.formatAnimationCurve = Curves.linear,
  this.pageAnimationEnabled = true,
  this.pageAnimationDuration = const Duration(milliseconds: 300),
  this.pageAnimationCurve = Curves.easeOut,
  this.startingDayOfWeek = StartingDayOfWeek.sunday,
  this.availableGestures = AvailableGestures.all,
  this.simpleSwipeConfig = const SimpleSwipeConfig(
    verticalThreshold: 25.0,
    swipeDetectionBehavior: SwipeDetectionBehavior.continuousDistinct,
  ),
  this.availableCalendarFormats = const {
    CalendarFormat.month: 'Month',
    CalendarFormat.twoWeeks: '2 weeks',
    CalendarFormat.week: 'Week',
  },
  this.onVerticalSwipe,
  this.onPageChanged,
  this.onCalendarCreated,
})  : assert(!dowVisible || (dowHeight != null && dowBuilder != null)),
      assert(isSameDay(focusedDay, firstDay) || focusedDay.isAfter(firstDay)),
      assert(isSameDay(focusedDay, lastDay) || focusedDay.isBefore(lastDay)),
      super(key: key);