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
onEventLongPressed is of type ValueChanged<NeatCleanCalendarEvent> and it contains a callback function
executed when an event of the event list is long pressed
datePickerType defines, if the date picker should get displayed and selects its type
Choose between datePickerType.hidden, datePickerType.year, datePickerType.date
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<NeatCleanCalendarEvent>>. This data structure contains the events to display
defaultDayColor is the color applied to days in the current month, that are not selected.
defaultOutOfMonthDayColor is the color applied to days outside the current month.
selectedColor this is the color, applied to the circle on the selected day
selectedTodayColor is the color, applied to the circle on the selected day, if it is today
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".
allDayEventText is a String. With this property you can set the caption of the all day event. If left empty, the
calendar will use the string "All day".
multiDayEndText is a String. With this property you can set the caption of the end of a multi day event. If left empty, the
calendar will use the string "End".
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
displayMonthTextStyle is a TextStyle for styling the month name in the top bar.
datePickerConfig is a DatePickerConfig object. It contains the configuration of the date picker, if enabled.
showEvents is a bool. This parameter allows the calender to show listed events. Default value is set to true
, but the user can hide the events entirely by setting it to false
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- Calendar
Constructors
-
Calendar({ValueChanged<
DateTime> ? onMonthChanged, ValueChanged<DateTime> ? onDateSelected, ValueChanged? onRangeSelected, ValueChanged<bool> ? onExpandStateChanged, ValueChanged<NeatCleanCalendarEvent> ? onEventSelected, ValueChanged<NeatCleanCalendarEvent> ? onEventLongPressed, bool hideBottomBar = false, bool isExpandable = false, Map<DateTime, List< ? events, List<NeatCleanCalendarEvent> >NeatCleanCalendarEvent> ? eventsList, DayBuilder? dayBuilder, EventListBuilder? eventListBuilder, DatePickerType? datePickerType = DatePickerType.hidden, bool hideTodayIcon = false, bool hideArrows = false, Color? defaultDayColor = Colors.black87, Color? defaultOutOfMonthDayColor, Color? selectedColor = Colors.pink, Color? selectedTodayColor, Color? todayColor, String todayButtonText = 'Today', String allDayEventText = 'All Day', String multiDayEndText = 'End', 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', TextStyle? displayMonthTextStyle, DatePickerConfig? datePickerConfig, double? eventTileHeight, bool showEvents = true}) - Configures the date picker if enabled
Properties
- allDayEventText → String
-
final
- bottomBarArrowColor → Color?
-
final
- bottomBarColor → Color?
-
final
- bottomBarTextStyle → TextStyle?
-
final
- datePickerConfig → DatePickerConfig?
-
final
- datePickerType → DatePickerType?
-
final
- dayBuilder → DayBuilder?
-
final
- dayOfWeekStyle → TextStyle?
-
final
- defaultDayColor → Color?
-
final
- defaultOutOfMonthDayColor → Color?
-
final
- displayMonthTextStyle → TextStyle?
-
final
- eventColor → Color?
-
final
- eventDoneColor → Color?
-
final
- eventListBuilder → EventListBuilder?
-
final
-
events
→ Map<
DateTime, List< ?NeatCleanCalendarEvent> > -
final
-
eventsList
→ List<
NeatCleanCalendarEvent> ? -
final
- eventTileHeight → double?
-
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
- multiDayEndText → String
-
final
-
onDateSelected
→ ValueChanged<
DateTime> ? -
final
-
onEventLongPressed
→ ValueChanged<
NeatCleanCalendarEvent> ? -
final
-
onEventSelected
→ ValueChanged<
NeatCleanCalendarEvent> ? -
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
- selectedTodayColor → Color?
-
final
- showEvents → bool
-
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