Skip to content
Get started
Menu
Get started

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.

Payment history date range triggers with custom dates, presets and a disabled field.Payment history date range triggers with custom dates, presets and a disabled field.
Date range picker
Payment history date range triggers with custom dates, presets and a disabled field at 200 percent text.
200% text
Date range presets sheet with recent periods and a Custom range action.Date range presets sheet with recent periods and a Custom range action.
Date range presets
Date range presets sheet with recent periods and a Custom range action at 200 percent text.
200% text
Date range calendar with selected dates and pinned Apply and Clear actions.Date range calendar with selected dates and pinned Apply and Clear actions.
Date range calendar
Date range calendar with selected dates and pinned Apply and Clear actions at 200 percent text.
200% text
Date range calendar with selected dates and pinned Apply and Clear actions, in Indonesian.
Indonesian
Date range calendar with selected dates and pinned Apply and Clear actions at 200 percent text, in Indonesian.
200% text, Indonesian
example/lib/screens/gallery_forms.dart
PaymentDateRangePicker(
label: 'Date range',
value: null,
enabled: false,
onChanged: (_) {},
firstDate: DateTime(2020),
lastDate: DateUtils.dateOnly(DateTime.now()),
);

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: preset, custom range; day, week, month, year granularity; field or .button.

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),
],
)

Empty, selected, disabled and error states use semantic tokens. In the calendar, days outside firstDate–lastDate are disabled and today has a ring.

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.

Use short labels and compact localized values.

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.

Example history screen with synthetic dataExample history screen with synthetic data
Example: history

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.

ParameterTypeDefaultDescription
label:requiredString—Visible name identifying this value or control.
value:requiredPaymentDateRange?—Current host-selected range.
onChanged:requiredValueChanged<PaymentDateRange?>—Reports the selected range to the host.
firstDate:requiredDateTime—Earliest selectable day in the host zone.
lastDate:requiredDateTime—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:PaymentSizePaymentSize.mediumSemantic control size; hit targets remain at least 48 dp.
enabled:booltrueWhether 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.

ParameterTypeDefaultDescription
label:requiredString—Visible name identifying this value or control.
value:requiredPaymentDateRange?—Current host-selected range.
onChanged:requiredValueChanged<PaymentDateRange?>—Reports the selected range to the host.
firstDate:requiredDateTime—Earliest selectable day in the host zone.
lastDate:requiredDateTime—Last selectable day in the host zone.
presets:List<PaymentDatePreset>const []Named ranges offered before the custom calendar.
enabled:booltrueWhether 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.

ParameterTypeDefaultDescription
start:requiredDateTime—First included calendar day in the host zone.
end:requiredDateTime—Last included calendar day in the host zone.

PaymentDateRange.fromPreset(…)

ParameterTypeDefaultDescription
presetrequiredpositionalPaymentDatePreset?—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.

ParameterTypeDefaultDescription
label:requiredString—Visible name identifying this value or control.
start:requiredDateTime—First included calendar day in the host zone.
end:requiredDateTime—Last included calendar day in the host zone.

PaymentDateGranularity

enum PaymentDateGranularity · lib/src/forms/date_range_picker.dart

Calendar grouping. Nothing else exists.

ValueDescription
dayDaily.
weekWeekly.
monthMonthly.
yearYearly.