GlassCalendar class

A month of days on glass, to pick a date from.

The header shows the month with buttons for the one before and after; a sideways swipe changes month too. Today is ringed, the picked day filled with the accent. Days before firstDate or after lastDate can't be picked. With the keyboard, the arrows move between days and enter picks.

Inheritance

Constructors

GlassCalendar.new({Key? key, required DateTime? selectedDate, required ValueChanged<DateTime>? onDateSelected, DateTime? initialMonth, DateTime? firstDate, DateTime? lastDate, DateTime? currentDate, int firstDayOfWeek = DateTime.monday, ValueChanged<DateTime>? onMonthChanged, Color? activeColor, double maxWidth = 360, String? semanticLabel, FocusNode? focusNode, bool autofocus = false})
Creates a calendar; firstDayOfWeek is a DateTime weekday, from DateTime.monday to DateTime.sunday.
const

Properties

activeColor → Color?
The picked day's fill. Defaults to the theme's accent.
final
autofocus → bool
Whether it takes focus when first built.
final
currentDate → DateTime?
Today. Defaults to now.
final
firstDate → DateTime?
The first day that can be picked, if any.
final
firstDayOfWeek → int
The day each week starts on, from DateTime.monday to DateTime.sunday.
final
focusNode → FocusNode?
Focuses the grid of days.
final
hashCode → int
The hash code for this object.
no setterinherited
initialMonth → DateTime?
The month shown first. Defaults to the selected date's, else today's.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lastDate → DateTime?
The last day that can be picked, if any.
final
maxWidth → double
The widest the calendar grows to.
final
onDateSelected → ValueChanged<DateTime>?
Called with the day tapped. Null makes the calendar read-only.
final
onMonthChanged → ValueChanged<DateTime>?
Called with the first of the month whenever the month shown changes.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectedDate → DateTime?
The picked day, or null for none. Only its date counts.
final
semanticLabel → String?
Names the control for assistive technology.
final

Methods

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