FCalendar constructor
FCalendar({
- required FCalendarController controller,
- FCalendarStyle style(
- FCalendarStyle style
- ValueWidgetBuilder<
FCalendarDayData> dayBuilder = defaultDayBuilder, - ValueChanged<
DateTime> ? onMonthChange, - ValueChanged<
DateTime> ? onPress, - ValueChanged<
DateTime> ? onLongPress, - FCalendarPickerType initialType = FCalendarPickerType.day,
- DateTime? start,
- DateTime? end,
- DateTime? today,
- DateTime? initialMonth,
- Key? key,
Creates a FCalendar.
Subsequently changing initialType has no effect.
initialMonth defaults to today. It is truncated to the nearest date. Subsequently changing initialMonth has
no effect. To change the selected date, change the key to create a new FCalendar, and provide that widget the
new initialMonth. This will reset the widget's interactive state.
Implementation
FCalendar({
required this.controller,
this.style,
this.dayBuilder = defaultDayBuilder,
this.onMonthChange,
this.onPress,
this.onLongPress,
FCalendarPickerType initialType = FCalendarPickerType.day,
DateTime? start,
DateTime? end,
DateTime? today,
DateTime? initialMonth,
super.key,
}) : start = start ?? DateTime(1900),
end = end ?? DateTime(2100),
today = today ?? DateTime.now(),
_initialType = initialType,
_initialMonth = (initialMonth ?? today ?? DateTime.now()).toLocalDate().truncate(to: DateUnit.months) {
assert(this.start.toLocalDate() < this.end.toLocalDate(), 'start ($start) must be < end ($end)');
}