TableCalendarCustomize<T> constructor

TableCalendarCustomize<T>({
  1. Key? key,
  2. required DateTime focusedDay,
  3. required DateTime firstDay,
  4. required DateTime lastDay,
  5. DateTime? currentDay,
  6. dynamic locale,
  7. DateTime? rangeStartDay,
  8. DateTime? rangeEndDay,
  9. List<int> weekendDays = const [DateTime.saturday, DateTime.sunday],
  10. CalendarFormat calendarFormat = CalendarFormat.month,
  11. Map<CalendarFormat, String> availableCalendarFormats = const {CalendarFormat.month : 'Month', CalendarFormat.twoWeeks : '2 weeks', CalendarFormat.week : 'Week'},
  12. CalendarTypeMode calendarTypeMode = CalendarTypeMode.day,
  13. Map<CalendarTypeMode, String> availableCalendarTypeModes = const {CalendarTypeMode.day : 'Day', CalendarTypeMode.year : 'Year'},
  14. bool headerVisible = true,
  15. bool daysOfWeekVisible = true,
  16. bool dividerVisible = true,
  17. bool pageJumpingEnabled = false,
  18. bool pageAnimationEnabled = true,
  19. bool sixWeekMonthsEnforced = false,
  20. bool shouldFillViewport = false,
  21. bool weekNumbersVisible = false,
  22. double rowHeight = 52.0,
  23. double daysOfWeekHeight = 16.0,
  24. Duration formatAnimationDuration = const Duration(milliseconds: 200),
  25. Curve formatAnimationCurve = Curves.linear,
  26. Duration pageAnimationDuration = const Duration(milliseconds: 300),
  27. Curve pageAnimationCurve = Curves.easeOut,
  28. StartingDayOfWeek startingDayOfWeek = StartingDayOfWeek.sunday,
  29. HitTestBehavior dayHitTestBehavior = HitTestBehavior.opaque,
  30. AvailableGestures availableGestures = AvailableGestures.all,
  31. SimpleSwipeConfig simpleSwipeConfig = const SimpleSwipeConfig(verticalThreshold: 25.0, swipeDetectionBehavior: SwipeDetectionBehavior.continuousDistinct),
  32. HeaderStyleCustomize headerStyle = const HeaderStyleCustomize(),
  33. DaysOfWeekStyleCustomize daysOfWeekStyle = const DaysOfWeekStyleCustomize(),
  34. CalendarStyleCustomize calendarStyle = const CalendarStyleCustomize(),
  35. CalendarBuildersCustomize<T> calendarBuilders = const CalendarBuildersCustomize(),
  36. YearCalendarStyleCustomize yearCalendarStyle = const YearCalendarStyleCustomize(),
  37. YearCalendarBuildersCustomize<T> yearCalendarBuilders = const YearCalendarBuildersCustomize(),
  38. RangeSelectionMode rangeSelectionMode = RangeSelectionMode.toggledOff,
  39. List<T> eventLoader(
    1. DateTime day
    )?,
  40. bool enabledDayPredicate(
    1. DateTime day
    )?,
  41. bool selectedDayPredicate(
    1. DateTime day
    )?,
  42. bool selectedYearPredicate(
    1. DateTime day
    )?,
  43. bool holidayPredicate(
    1. DateTime day
    )?,
  44. OnRangeSelected? onRangeSelected,
  45. OnDaySelected? onDaySelected,
  46. OnDaySelected? onDayLongPressed,
  47. void onDisabledDayTapped(
    1. DateTime day
    )?,
  48. void onDisabledDayLongPressed(
    1. DateTime day
    )?,
  49. void onHeaderTapped(
    1. DateTime focusedDay
    )?,
  50. void onHeaderLongPressed(
    1. DateTime focusedDay
    )?,
  51. void onPageChanged(
    1. DateTime focusedDay
    )?,
  52. void onFormatChanged(
    1. CalendarFormat format
    )?,
  53. void onTypeModeChanged(
    1. CalendarTypeMode typeMode
    )?,
  54. void onCalendarCreated(
    1. PageController pageController
    )?,
  55. void onDragEnd(
    1. CalendarFormat calendarFormat
    )?,
  56. void onTapItemTypeModeYear(
    1. int year
    )?,
})

Creates a TableCalendarCustomize widget.

Implementation

TableCalendarCustomize({
  Key? key,
  required DateTime focusedDay,
  required DateTime firstDay,
  required DateTime lastDay,
  DateTime? currentDay,
  this.locale,
  this.rangeStartDay,
  this.rangeEndDay,
  this.weekendDays = const [DateTime.saturday, DateTime.sunday],
  this.calendarFormat = CalendarFormat.month,
  this.availableCalendarFormats = const {
    CalendarFormat.month: 'Month',
    CalendarFormat.twoWeeks: '2 weeks',
    CalendarFormat.week: 'Week',
  },
  this.calendarTypeMode = CalendarTypeMode.day,
  this.availableCalendarTypeModes = const {
    CalendarTypeMode.day: 'Day',
    CalendarTypeMode.year: 'Year',
  },
  this.headerVisible = true,
  this.daysOfWeekVisible = true,
  this.dividerVisible = true,
  this.pageJumpingEnabled = false,
  this.pageAnimationEnabled = true,
  this.sixWeekMonthsEnforced = false,
  this.shouldFillViewport = false,
  this.weekNumbersVisible = false,
  this.rowHeight = 52.0,
  this.daysOfWeekHeight = 16.0,
  this.formatAnimationDuration = const Duration(milliseconds: 200),
  this.formatAnimationCurve = Curves.linear,
  this.pageAnimationDuration = const Duration(milliseconds: 300),
  this.pageAnimationCurve = Curves.easeOut,
  this.startingDayOfWeek = StartingDayOfWeek.sunday,
  this.dayHitTestBehavior = HitTestBehavior.opaque,
  this.availableGestures = AvailableGestures.all,
  this.simpleSwipeConfig = const SimpleSwipeConfig(
    verticalThreshold: 25.0,
    swipeDetectionBehavior: SwipeDetectionBehavior.continuousDistinct,
  ),
  this.headerStyle = const HeaderStyleCustomize(),
  this.daysOfWeekStyle = const DaysOfWeekStyleCustomize(),
  this.calendarStyle = const CalendarStyleCustomize(),
  this.calendarBuilders = const CalendarBuildersCustomize(),
  this.yearCalendarStyle = const YearCalendarStyleCustomize(),
  this.yearCalendarBuilders = const YearCalendarBuildersCustomize(),
  this.rangeSelectionMode = RangeSelectionMode.toggledOff,
  this.eventLoader,
  this.enabledDayPredicate,
  this.selectedDayPredicate,
  this.selectedYearPredicate,
  this.holidayPredicate,
  this.onRangeSelected,
  this.onDaySelected,
  this.onDayLongPressed,
  this.onDisabledDayTapped,
  this.onDisabledDayLongPressed,
  this.onHeaderTapped,
  this.onHeaderLongPressed,
  this.onPageChanged,
  this.onFormatChanged,
  this.onTypeModeChanged,
  this.onCalendarCreated,
  this.onDragEnd,
  this.onTapItemTypeModeYear,
})  : assert(availableCalendarFormats.keys.contains(calendarFormat)),
      assert(availableCalendarFormats.length <= CalendarFormat.values.length),
      assert(availableCalendarTypeModes.keys.contains(calendarTypeMode)),
      assert(availableCalendarTypeModes.length <=
          CalendarTypeMode.values.length),
      assert(weekendDays.isNotEmpty
          ? weekendDays.every(
              (day) => day >= DateTime.monday && day <= DateTime.sunday)
          : true),
      focusedDay = normalizeDate(focusedDay),
      firstDay = normalizeDate(firstDay),
      lastDay = normalizeDate(lastDay),
      currentDay = currentDay ?? DateTime.now(),
      super(key: key);