Date range picker
A complete calendar range for payment history filters. Presets come first; “Custom range” opens a full-height kit range calendar with a pinned Apply footer.











PaymentDateRangePicker( label: 'Date range', value: null, enabled: false, onChanged: (_) {}, firstDate: DateTime(2020), lastDate: DateUtils.dateOnly(DateTime.now()), );Behavior
Section titled “Behavior”Presets live in a kit sheet before the calendar; “Custom range” is a radio row on the presets’ text column. The picker returns calendar dates; you decide which time zone they mean. Granularity tabs remain below the trigger. fromPreset preserves the named range. formatDateRange produces shared localized text for fields and chips.
Range calendar. A full-height sheet with a scrolling list of months from firstDate to lastDate, opened at the range’s start or today. The first tap sets the start, the second the end; a tap before the start, or after a complete range, starts again. The range is shown in the accent: filled circles on its ends and a band between them. “Type dates” in the header swaps the calendar for two typed date fields (start on or before end, both in range). The pinned footer shows the range (or “Choose an end date”), a full-width “Apply” that is enabled once a start exists (a start alone applies a one-day range) and a quiet “Clear” that reports null. Pass lastDate: today for history, so future days are disabled.
Variants
Section titled “Variants”Variants: preset, custom range; day, week, month, year granularity; field or .button.
Which variant when
Section titled “Which variant when”| Situation | Variant / composition | Payment example |
|---|---|---|
| History period | preset | Offer last seven days and month presets; custom range handles other periods. |
Use Date field for a single birthday.
Icon button. PaymentDateRangePicker.button opens the same presets sheet and range calendar from a 48 dp calendar icon instead of a labelled field, for a filter line such as TransactionHistory.searchActions. label is its tooltip and spoken name. While a range is set the glyph fills, takes the accent and reads as selected, with the range as its spoken value. It shows no value on screen, so show the range as an active-filter PaymentChip with a close button.
TransactionHistory( records: records, query: query, filter: filter, onQueryChanged: setQuery, onFilterChanged: setFilter, onOpen: openDetail, searchActions: [ PaymentDateRangePicker.button(label: 'Date range', value: range, onChanged: setRange, firstDate: DateTime(2026), lastDate: today, presets: presets), ],)States
Section titled “States”Empty, selected, disabled and error states use semantic tokens. In the calendar, days outside firstDate–lastDate are disabled and today has a ring.
Do and don’t
Section titled “Do and don’t”Do: Offer last seven days and month presets; custom range handles other periods.
Don’t: Convert zones or infer host reporting boundaries in the kit.
Content guidelines
Section titled “Content guidelines”Use short labels and compact localized values.
Accessibility
Section titled “Accessibility”Targets are at least 48 dp. The sheets return focus to the trigger. Each day is read as its full date with its state (“Monday, 5 October 2026, selected, range start”); arrow keys move by a day or a week and Enter picks. The footer summary is a live region. Weeks start on Monday in Indonesian and Sunday in English.
In the example app
Section titled “In the example app”

Customization
Section titled “Customization”The default PaymentDateRangePicker field follows the field-family PaymentFieldTheme; the calendar and preset panels keep their own styling. PaymentDateRangePicker.button is an icon button, so the field theme does not change it. See Text field customization.
PaymentDateRangePicker
class PaymentDateRangePicker extends StatefulWidget · lib/src/forms/date_range_picker.dart
Preset sheet or the kit range calendar (D51); performs no zone conversion.
"Custom range" opens a full-height sheet with a scrolling month calendar (first tap the start, second tap the end), typed entry from its header, and a pinned footer with the range, a full-width Apply and Clear.
| Parameter | Type | Default | Description |
|---|---|---|---|
label:required | String | — | Visible name identifying this value or control. |
value:required | PaymentDateRange? | — | Current host-selected range. |
onChanged:required | ValueChanged<PaymentDateRange?> | — | Reports the selected range to the host. |
firstDate:required | DateTime | — | Earliest selectable day in the host zone. |
lastDate:required | DateTime | — | Last selectable day in the host zone. |
presets: | List<PaymentDatePreset> | const [] | Named ranges offered before the custom calendar. |
granularity: | PaymentDateGranularity? | — | Current host-selected grouping of calendar periods. |
onGranularityChanged: | ValueChanged<PaymentDateGranularity>? | — | Reports a grouping choice to the host. |
description: | String? | — | Persistent explanation below the heading or label. |
errorText: | String? | — | Safe error copy displayed with the affected content. |
size: | PaymentSize | PaymentSize.medium | Semantic control size; hit targets remain at least 48 dp. |
enabled: | bool | true | Whether the customer can change this control. |
PaymentDateRangePicker.button(…) — A calendar icon button that opens the same presets and range sheet, for a filter line such as TransactionHistory.searchActions.
label is its tooltip and spoken name. While a range is set the glyph fills, takes the accent and reads as selected; show the range itself as an active-filter chip, since the button has no visible value.
| Parameter | Type | Default | Description |
|---|---|---|---|
label:required | String | — | Visible name identifying this value or control. |
value:required | PaymentDateRange? | — | Current host-selected range. |
onChanged:required | ValueChanged<PaymentDateRange?> | — | Reports the selected range to the host. |
firstDate:required | DateTime | — | Earliest selectable day in the host zone. |
lastDate:required | DateTime | — | Last selectable day in the host zone. |
presets: | List<PaymentDatePreset> | const [] | Named ranges offered before the custom calendar. |
enabled: | bool | true | Whether the customer can change this control. |
PaymentDateRange
class PaymentDateRange · lib/src/forms/date_range_picker.dart
A complete range in the host zone, optionally from a preset.
| Parameter | Type | Default | Description |
|---|---|---|---|
start:required | DateTime | — | First included calendar day in the host zone. |
end:required | DateTime | — | Last included calendar day in the host zone. |
PaymentDateRange.fromPreset(…)
| Parameter | Type | Default | Description |
|---|---|---|---|
presetrequiredpositional | PaymentDatePreset? | — | Named host range used for this selection, if any. |
PaymentDatePreset
class PaymentDatePreset · lib/src/forms/date_range_picker.dart
A host-named complete calendar range.
| Parameter | Type | Default | Description |
|---|---|---|---|
label:required | String | — | Visible name identifying this value or control. |
start:required | DateTime | — | First included calendar day in the host zone. |
end:required | DateTime | — | Last included calendar day in the host zone. |
PaymentDateGranularity
enum PaymentDateGranularity · lib/src/forms/date_range_picker.dart
Calendar grouping. Nothing else exists.
| Value | Description |
|---|---|
day | Daily. |
week | Weekly. |
month | Monthly. |
year | Yearly. |