Skip to content
Get started
Menu
Get started

Date field

Collect a date by typing it (DD/MM/YYYY). The calendar button opens a kit sheet: a day / month / year wheel for far dates such as a date of birth, or a month calendar for near dates, both ending in a full-width “Choose date”.

Date of birth and transfer date fields with empty, filled, invalid and disabled states.Date of birth and transfer date fields with empty, filled, invalid and disabled states.
Date field
Date of birth and transfer date fields with empty, filled, invalid and disabled states at 200 percent text.
200% text
Date of birth and transfer date fields with empty, filled, invalid and disabled states at 200 percent text, in Indonesian.
200% text, Indonesian
Date of birth wheel sheet with day, month and year columns and a Choose date action.Date of birth wheel sheet with day, month and year columns and a Choose date action.
Date field sheet wheel
Date of birth wheel sheet with day, month and year columns and a Choose date action at 200 percent text.
200% text
Date of birth wheel sheet with day, month and year columns and a Choose date action, in Indonesian.
Indonesian
Transfer date calendar sheet with month navigation, selectable days and a Choose date action.Transfer date calendar sheet with month navigation, selectable days and a Choose date action.
Date field sheet calendar
Transfer date calendar sheet with month navigation, selectable days and a Choose date action at 200 percent text.
200% text
example/lib/screens/gallery_forms.dart
PaymentDateField(
label: 'Date of birth',
value: DateTime(1995, 8, 17),
onChanged: (_) {},
firstDate: DateTime(1900),
lastDate: DateUtils.dateOnly(DateTime.now()),
);

The app-wide date pattern is a hint and persistent caption. Separators are inserted without moving focus. Invalid input shows on blur or Form validation; correcting it clears the kit error. Put age and range rules in your own validator. No per-field pattern override exists.

Picker by purpose. The kit picks the sheet from the allowed span; there is no picker parameter. When lastDate is more than five years after firstDate (DateTime(first.year + 5, first.month, first.day) is before lastDate), the button opens the wheel: day, month and year columns in the typed pattern’s order, opening at the value or, when empty, at lastDate. Days clamp to the month, and dates outside the range are drawn disabled and settle back inside it. Otherwise it opens a full-height month calendar at the value’s month or today’s, with weeks starting on Monday in Indonesian and Sunday in English. Both sheets are built in the kit, so they use kit colours and strings in en and id without GlobalMaterialLocalizations. Pass lastDate: today for past dates such as a date of birth.

Variants: typed entry with a wheel sheet (span over five years), typed entry with a calendar sheet.

Situation Variant / composition Payment example
KYC birth date typed entry, wheel (1900 to today) Use host age/range validation; the app-wide pattern remains visible.
Transfer or due date typed entry, calendar (today to 90 days) A near span shows weekdays.

Use Date range picker for a period.

Default, focused, disabled and error. Errors include an icon, text and an edge. Selection controls support hardware keyboards.

Do: Use host age/range validation; the app-wide pattern remains visible.

Don’t: Use a hint as the only date-format instruction.

Use short, specific labels and explain how to correct an error.

Input text is 16 dp. Legends precede fields in reading order. Labels and errors stay in semantics when visually hidden. The sheets return focus to the field. Each calendar day is a 48 dp button read as its full date (“Tuesday, 20 October 2026, today”); arrow keys move by a day or a week and Enter picks. Each wheel column is adjustable (swipe up or down with a screen reader) and its items grow with the text.

Example kyc onboarding screen with synthetic dataExample kyc onboarding screen with synthetic data
Example: kyc onboarding

The date box follows the field-family PaymentFieldTheme. The calendar and wheel sheets keep their own styling. See Text field customization.

PaymentDateField

class PaymentDateField extends StatefulWidget · lib/src/forms/date_field.dart

Typed calendar date with a kit date sheet. Host owns range rules.

Typing DD/MM/YYYY is the primary path. The calendar button opens a wheel when the allowed span is more than five years (date of birth), otherwise a month calendar; both end in a full-width "Choose date" (D52, D52a).

ParameterTypeDefaultDescription
label:requiredString—label for this field.
value:requiredDateTime?—value for this field.
onChanged:requiredValueChanged<DateTime?>—onChanged for this field.
firstDate:requiredDateTime—firstDate for this field.
lastDate:requiredDateTime—lastDate for this field.
validator:FormFieldValidator<DateTime>?—validator for this field.
description:String?—description for this field.
errorText:String?—errorText for this field.
required:boolfalserequired for this field.
hiddenElements:Set<PaymentFieldPart>const {}hiddenElements for this field.
size:PaymentSizePaymentSize.mediumsize for this field.
enabled:booltrueenabled for this field.
focusNode:FocusNode?—focusNode for this field.
textInputAction:TextInputAction?—textInputAction for this field.