FCalendar class

A calendar.

The calendar pages are designed to be navigable through swipe gestures on mobile Android, iOS & iPadOS, allowing left and right swipes to transition between pages.

All DateTimes are in UTC timezone. A FDateSelectionControl is used to customize the date selection behavior. DateTimes outside the start and end dates are unselectable.

See:

Inheritance

Constructors

FCalendar.grid({required FDateSelectionControl selectionControl, FGridCalendarControl control = const FGridCalendarControl(), FCalendarStyleDelta style = const .context(), bool fixedWeeks = false, ScrollPhysics? dayScrollPhysics, ScrollCacheExtent? dayScrollCacheExtent, ScrollBehavior? dayScrollBehavior, ScrollPhysics? monthScrollPhysics, ScrollCacheExtent? monthScrollCacheExtent, ScrollBehavior? monthScrollBehavior, ScrollPhysics? yearScrollPhysics, ScrollCacheExtent? yearScrollCacheExtent, ScrollBehavior? yearScrollBehavior, FCalendarHeaderBuilder<FGridCalendarController> headerBuilder = defaultHeaderBuilder, FCalendarFooterBuilder<FGridCalendarController> footerBuilder = defaultFooterBuilder, FCalendarDayBuilder dayBuilder = defaultDayBuilder, FCalendarMonthBuilder monthBuilder = defaultMonthBuilder, FCalendarYearBuilder yearBuilder = defaultYearBuilder, FutureOr<void> onDayPress(DateTime)?, FutureOr<void> onDayLongPress(DateTime)?, Key? key})
Creates a FCalendar that cycles through the day, month and year grid pickers.
FCalendar.splitGrid({required FDateSelectionControl selectionControl, FGridSplitCalendarControl control = const FGridSplitCalendarControl(), FCalendarStyleDelta style = const .context(), bool fixedWeeks = false, ScrollPhysics? dayScrollPhysics, ScrollCacheExtent? dayScrollCacheExtent, ScrollBehavior? dayScrollBehavior, ScrollPhysics? yearScrollPhysics, ScrollCacheExtent? yearScrollCacheExtent, ScrollBehavior? yearScrollBehavior, FCalendarHeaderBuilder<FGridSplitCalendarController> headerBuilder = defaultHeaderBuilder, FCalendarFooterBuilder<FGridSplitCalendarController> footerBuilder = defaultFooterBuilder, FCalendarDayBuilder dayBuilder = defaultDayBuilder, FCalendarMonthBuilder monthBuilder = defaultMonthBuilder, FCalendarYearBuilder yearBuilder = defaultYearBuilder, FutureOr<void> onDayPress(DateTime)?, FutureOr<void> onDayLongPress(DateTime)?, Key? key})
Creates a FCalendar with a split header whose month and year grid pickers are independently togglable.
FCalendar.wheel({required FDateSelectionControl selectionControl, FWheelCalendarControl control = const FWheelCalendarControl(), FCalendarStyleDelta style = const .context(), bool fixedWeeks = false, ScrollPhysics? dayScrollPhysics, ScrollCacheExtent? dayScrollCacheExtent, ScrollBehavior? dayScrollBehavior, bool loop = false, int monthFlex = 1, int yearFlex = 1, FCalendarHeaderBuilder<FWheelCalendarController> headerBuilder = defaultHeaderBuilder, FCalendarFooterBuilder<FWheelCalendarController> footerBuilder = defaultFooterBuilder, FCalendarDayBuilder dayBuilder = defaultDayBuilder, FutureOr<void> onDayPress(DateTime)?, FutureOr<void> onDayLongPress(DateTime)?, Key? key})
Creates a FCalendar that toggles between a day grid picker and a month-year wheel picker.

Properties

control FCalendarControl
Defines how this calendar's navigation is controlled.
final
fixedWeeks bool
Whether the day grid always shows 6 week-rows instead of adapting its height to the month's 4-6 weeks. Defaults to false.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onDayLongPress FutureOr<void> Function(DateTime)?
A callback for when a date in a day picker is long pressed.
final
onDayPress FutureOr<void> Function(DateTime)?
A callback for when a day in a day picker is pressed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectionControl FDateSelectionControl
Defines how this calendar's date selection is controlled.
final
style FCalendarStyleDelta
The style.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<FCalendar>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

defaultDayBuilder(BuildContext context, FCalendarDayStyles styles, FLocalizations localizations, DateTime date, Set<FCalendarDayVariant> variants) Widget
The default FCalendarDayBuilder for a day picker.
defaultFooterBuilder<C extends FCalendarController>(BuildContext context, C controller, FDateSelectionController selectionController) Widget
The default FCalendarFooterBuilder which renders no footer.
defaultHeaderBuilder<C extends FCalendarController>(BuildContext context, C controller, FDateSelectionController selectionController, Widget child) Widget
The default FCalendarHeaderBuilder which returns the given child unchanged.
defaultMonthBuilder(BuildContext context, FCalendarMonthStyles styles, FLocalizations localizations, DateTime date, Set<FCalendarMonthVariant> variants) Widget
The default FCalendarMonthBuilder for a month picker.
defaultYearBuilder(BuildContext context, FCalendarYearStyles styles, FLocalizations localizations, DateTime date, Set<FCalendarYearVariant> variants) Widget
The default FCalendarYearBuilder for a year picker.