DatePicker
A month-at-a-time date picker. Renders a header (< January 2024 >),
the day-of-week row, and a 7-column day grid. The current selection
(value) is highlighted; cursor navigation moves it.
Learn more: Forms & validation
Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.
DatePicker( value: _date, label: 'Date', onChanged: (date) => setState(() => _date = date),)Details
Section titled “Details”Keys when focused:
← / →move by one day within the week row↑ / ↓move by one week within the monthPageUp / PageDownprevious / next monthHome / Endfirst / last day of the visible month[ / ]previous / next yeartjump to todayEnterconsume (selection already committed on each move)
An arrow that would step off the week row or out of the month passes on instead, so directional focus traversal can leave the calendar; use PageUp and PageDown to change months.
Controlled — hold the value yourself and update it from onChanged.
Days outside [firstDate, lastDate] (when provided) are dimmed, and the
selection can’t move onto them. Passing null for onChanged disables the
picker.
Constructors
Section titled “Constructors”DatePicker()
Section titled “DatePicker()”| Parameter | Type | Default | Description |
|---|---|---|---|
value: | DateTime | required | Currently-selected day (only the y/m/d portion is read). |
onChanged: | void Function(DateTime date)? | required | Called when keyboard, pointer, or semantic interaction selects a day. Enter is consumed without invoking this callback because navigation has already committed the selection. |
firstDate: | DateTime? | — | Lower bound (inclusive). Days before this are dimmed and skipped. |
lastDate: | DateTime? | — | Upper bound (inclusive). Days after this are dimmed and skipped. |
weekStartsOn: | CalendarWeekStart | CalendarWeekStart.sunday | Which day starts a week — drives the day-of-week header order and the column layout. Defaults to Sunday (matches CalendarHeatmap). |
label: | String? | — | Optional label exposed through the semantic app graph. |
focusNode: | FocusNode? | — | Focus node used for keyboard navigation. |
autofocus: | bool | false | Whether the picker requests focus when mounted. |
style: | CellStyle? | — | Base styling, plus optional focus, selected, disabled, and invalid state entries from CellStyle.interactive. |
Source
Section titled “Source”DatePicker is defined in packages/fleury/lib/src/catalog/date_picker.dart.
Category: Inputs & controls · All widgets