DateRangePickerDialog class

A Material-style date range picker dialog.

It is used internally by showDateRangePicker or can be directly pushed onto the Navigator stack to enable state restoration. See showDateRangePicker for a state restoration app example.

See also:

Inheritance

Constructors

DateRangePickerDialog({Key? key, DateTimeRange<DateTime>? initialDateRange, required DateTime firstDate, required DateTime lastDate, DateTime? currentDate, DatePickerEntryMode initialEntryMode = DatePickerEntryMode.calendar, String? helpText, String? cancelText, String? confirmText, String? saveText, String? errorInvalidRangeText, String? errorFormatText, String? errorInvalidText, String? fieldStartHintText, String? fieldEndHintText, String? fieldStartLabelText, String? fieldEndLabelText, TextInputType keyboardType = TextInputType.datetime, String? restorationId, Icon? switchToInputEntryModeIcon, Icon? switchToCalendarEntryModeIcon, SelectableDayForRangePredicate? selectableDayPredicate, CalendarDelegate<DateTime> calendarDelegate = const GregorianCalendarDelegate()})
A Material-style date range picker dialog.
const

Properties

calendarDelegate → CalendarDelegate<DateTime>
The calendarDelegate controls date interpretation, formatting, and navigation within the picker. By providing a custom implementation, you can support alternative calendar systems such as Nepali, Hijri, Buddhist, and more. Defaults to GregorianCalendarDelegate.
final
cancelText → String?
The label on the cancel button for the text input mode.
final
confirmText → String?
The label on the "OK" button for the text input mode.
final
currentDate → DateTime
The currentDate represents the current day (i.e. today).
no setter
errorFormatText → String?
The message used when an input text isn't in a proper date format.
final
errorInvalidRangeText → String?
The message used when the date range is invalid (e.g. start date is after end date).
final
errorInvalidText → String?
The message used when an input text isn't a selectable date.
final
fieldEndHintText → String?
The text used to prompt the user when no text has been entered in the end field.
final
fieldEndLabelText → String?
The label for the end date text input field.
final
fieldStartHintText → String?
The text used to prompt the user when no text has been entered in the start field.
final
fieldStartLabelText → String?
The label for the start date text input field.
final
firstDate → DateTime
The earliest allowable date on the date range.
final
hashCode → int
The hash code for this object.
no setterinherited
helpText → String?
The label displayed at the top of the dialog.
final
initialDateRange → DateTimeRange<DateTime>?
The date range that the date range picker starts with when it opens.
final
initialEntryMode → DatePickerEntryMode
The initial date range picker entry mode.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType → TextInputType
The keyboard type of the TextField.
final
lastDate → DateTime
The latest allowable date on the date range.
final
restorationId → String?
Restoration ID to save and restore the state of the DateRangePickerDialog.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
saveText → String?
The label on the save button for the fullscreen calendar mode.
final
selectableDayPredicate → SelectableDayForRangePredicate?
Function to provide full control over which DateTime can be selected.
final
switchToCalendarEntryModeIcon → Icon?
An optional switchToCalendarEntryModeIcon argument can be used to display a custom Icon in the corner of the dialog when DatePickerEntryMode is DatePickerEntryMode.input. Clicking on icon changes the DatePickerEntryMode to DatePickerEntryMode.calendar. If null, Icon(Icons.calendar_today) is used.
final
switchToInputEntryModeIcon → Icon?
An optional switchToInputEntryModeIcon argument can be used to display a custom Icon in the corner of the dialog when DatePickerEntryMode is DatePickerEntryMode.calendar. Clicking on icon changes the DatePickerEntryMode to DatePickerEntryMode.input. If null, Icon(useMaterial3 ? Icons.edit_outlined : Icons.edit) is used.
final

Methods

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