TableCalendarCustomize<T> constructor
TableCalendarCustomize<T> ({
- Key? key,
- required DateTime focusedDay,
- required DateTime firstDay,
- required DateTime lastDay,
- DateTime? currentDay,
- dynamic locale,
- DateTime? rangeStartDay,
- DateTime? rangeEndDay,
- List<
int> weekendDays = const [DateTime.saturday, DateTime.sunday], - CalendarFormat calendarFormat = CalendarFormat.month,
- Map<
CalendarFormat, String> availableCalendarFormats = const {CalendarFormat.month : 'Month', CalendarFormat.twoWeeks : '2 weeks', CalendarFormat.week : 'Week'}, - CalendarTypeMode calendarTypeMode = CalendarTypeMode.day,
- Map<
CalendarTypeMode, String> availableCalendarTypeModes = const {CalendarTypeMode.day : 'Day', CalendarTypeMode.year : 'Year'}, - bool headerVisible = true,
- bool daysOfWeekVisible = true,
- bool dividerVisible = true,
- bool pageJumpingEnabled = false,
- bool pageAnimationEnabled = true,
- bool sixWeekMonthsEnforced = false,
- bool shouldFillViewport = false,
- bool weekNumbersVisible = false,
- double rowHeight = 52.0,
- double daysOfWeekHeight = 16.0,
- Duration formatAnimationDuration = const Duration(milliseconds: 200),
- Curve formatAnimationCurve = Curves.linear,
- Duration pageAnimationDuration = const Duration(milliseconds: 300),
- Curve pageAnimationCurve = Curves.easeOut,
- StartingDayOfWeek startingDayOfWeek = StartingDayOfWeek.sunday,
- HitTestBehavior dayHitTestBehavior = HitTestBehavior.opaque,
- AvailableGestures availableGestures = AvailableGestures.all,
- SimpleSwipeConfig simpleSwipeConfig = const SimpleSwipeConfig(verticalThreshold: 25.0, swipeDetectionBehavior: SwipeDetectionBehavior.continuousDistinct),
- HeaderStyleCustomize headerStyle = const HeaderStyleCustomize(),
- DaysOfWeekStyleCustomize daysOfWeekStyle = const DaysOfWeekStyleCustomize(),
- CalendarStyleCustomize calendarStyle = const CalendarStyleCustomize(),
- CalendarBuildersCustomize<
T> calendarBuilders = const CalendarBuildersCustomize(), - YearCalendarStyleCustomize yearCalendarStyle = const YearCalendarStyleCustomize(),
- YearCalendarBuildersCustomize<
T> yearCalendarBuilders = const YearCalendarBuildersCustomize(), - RangeSelectionMode rangeSelectionMode = RangeSelectionMode.toggledOff,
- List<
T> eventLoader(- DateTime day
- bool enabledDayPredicate(
- DateTime day
- bool selectedDayPredicate(
- DateTime day
- bool selectedYearPredicate(
- DateTime day
- bool holidayPredicate(
- DateTime day
- OnRangeSelected? onRangeSelected,
- OnDaySelected? onDaySelected,
- OnDaySelected? onDayLongPressed,
- void onDisabledDayTapped(
- DateTime day
- void onDisabledDayLongPressed(
- DateTime day
- void onHeaderTapped(
- DateTime focusedDay
- void onHeaderLongPressed(
- DateTime focusedDay
- void onPageChanged(
- DateTime focusedDay
- void onFormatChanged(
- CalendarFormat format
- void onTypeModeChanged(
- CalendarTypeMode typeMode
- void onCalendarCreated(
- PageController pageController
- void onDragEnd(
- CalendarFormat calendarFormat
- void onTapItemTypeModeYear(
- 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);