FCalendar constructor
FCalendar({
- required FCalendarController controller,
- required DateTime start,
- required DateTime end,
- FCalendarStyle? style,
- ValueChanged<
DateTime> ? onMonthChange, - ValueChanged<
DateTime> ? onPress, - ValueChanged<
DateTime> ? onLongPress, - FCalendarPickerType initialType = FCalendarPickerType.day,
- DateTime? today,
- DateTime? initialMonth,
- Key? key,
Creates a FCalendar.
initialMonth
defaults to today
. It is truncated to the nearest date.
Implementation
FCalendar({
required this.controller,
required this.start,
required this.end,
this.style,
this.onMonthChange,
this.onPress,
this.onLongPress,
FCalendarPickerType initialType = FCalendarPickerType.day,
DateTime? today,
DateTime? initialMonth,
super.key,
}) : assert(start.toLocalDate() < end.toLocalDate(), 'end date must be greater than start date'),
today = today ?? DateTime.now(),
_type = ValueNotifier(initialType),
_month = ValueNotifier((initialMonth ?? today ?? DateTime.now()).toLocalDate().truncate(to: DateUnit.months));