Calendar class

Clean Calndar's main class Calendar

This calls is responisble for controlling the look of the calnedar display as well as the action taken, when changing the month or tapping a date. It's higly configurable with its numerous properties.

onDateSelected is of type ValueChanged<DateTime> and it containes the callback function extecuted when tapping a date onMonthChanged is of type ValueChanged<DateTime> and it containes the callback function extecuted when changing to another month onExpandStateChanged is of type ValueChanged<bool> and it contains a callback function executed when the view changes to expanded or to condensed onRangeSelected contains a callback function of type ValueChanged, that gets called on changes of the range (switch to next or previous week or month) onEventSelected is of type ValueChanged<NeatCleanCalendarEvent> and it contains a callback function executed when an event of the event list is selected isExpandable is a bool. With this parameter you can control, if the view can expand from week view to month view. Default is false. dayBuilder can contain a Widget. If this property is not null (!= null), this widget will get used to render the calenar tiles (so you can customize the view) eventListBuilder can optionally contain a Widget that gets used to render the event list hideArrows is a bool. When set to true the arrows to navigate to the next or previous week/month in the top bar well get suppressed. Default is false. hideTodayIcon is a bool. When set to true the dispaly of the Today-Icon (button to navigate to today) in the top bar well get suppressed. Default is false. hideBottomBar at the moment has no function. Default is false. events are of type Map<DateTime, List<CleanCalendarEvent>>. This data structure containes the events to display selctedColor this is the color, applied to the circle on the selcted day todayColor this is the color of the date of today todayButtonText is a String. With this property you can set the caption of the today icon (button to navigate to today). If left empty, the calendar will use the string "Today". eventColor lets you optionally specify the color of the event (dot). If the CleanCaendarEvents property color is not set, the calendar will use this parameter. eventDoneColor with this property you can define the color of "done" events, that is events in the past. initialDate is of type DateTime. It can contain an optional start date. This is the day, that gets initially selected by the calendar. The default is to not set this parameter. Then the calendar uses DateTime.now() isExpanded is a bool. If is us set to true, the calendar gets rendered in month view. weekDays contains a List<String> defining the names of the week days, so that it is possible to name them according to your current locale. locale is a String. This setting gets used to format dates according to the current locale. startOnMonday is a bool. This parameter allows the calendar to determine the first day of the week. dayOfWeekStyle is a TextStyle for styling the text of the weekday names in the top bar. bottomBarTextStyle is a TextStyle, that sets the style of the text in the bottom bar. bottomBarArrowColor can set the Color of the arrow to expand/compress the calendar in the bottom bar. bottomBarColor sets the Color of the bottom bar expandableDateFormat defines the formatting of the date in the bottom bar

Inheritance

Constructors

Calendar({ValueChanged<DateTime>? onMonthChanged, ValueChanged<DateTime>? onDateSelected, ValueChanged? onRangeSelected, ValueChanged<bool>? onExpandStateChanged, ValueChanged<CleanCalendarEvent>? onEventSelected, bool hideBottomBar = false, bool isExpandable = false, Map<DateTime, List<CleanCalendarEvent>>? events, DayBuilder? dayBuilder, EventListBuilder? eventListBuilder, bool hideTodayIcon = false, bool hideArrows = false, Color? selectedColor, Color? todayColor, String todayButtonText = 'Today', Color? eventColor, Color? eventDoneColor, DateTime? initialDate, bool isExpanded = false, List<String> weekDays = const ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], String? locale = 'en_US', bool startOnMonday = false, TextStyle? dayOfWeekStyle, TextStyle? bottomBarTextStyle, Color? bottomBarArrowColor, Color? bottomBarColor, String? expandableDateFormat = 'EEEE MMMM dd, yyyy'})

Properties

bottomBarArrowColor Color?
final
bottomBarColor Color?
final
bottomBarTextStyle TextStyle?
final
dayBuilder DayBuilder?
final
dayOfWeekStyle TextStyle?
final
eventColor Color?
final
eventDoneColor Color?
final
eventListBuilder EventListBuilder?
final
events Map<DateTime, List<CleanCalendarEvent>>?
final
expandableDateFormat String?
final
hashCode int
The hash code for this object.
no setterinherited
hideArrows bool
final
hideBottomBar bool
final
hideTodayIcon bool
final
initialDate DateTime?
final
isExpandable bool
final
isExpanded bool
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
locale String?
final
onDateSelected ValueChanged<DateTime>?
final
onEventSelected ValueChanged<CleanCalendarEvent>?
final
onExpandStateChanged ValueChanged<bool>?
final
onMonthChanged ValueChanged<DateTime>?
final
onRangeSelected ValueChanged?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedColor Color?
final
startOnMonday bool
final
todayButtonText String
final
todayColor Color?
final
weekDays List<String>
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _CalendarState
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.
inherited
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}) 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