DateRangePickerWidget class

A widget that displays a date range picker.

The onDateRangeChanged callback is called whenever the selected date range is changed.

The initialDisplayedDate is the date that is initially displayed when the picker is opened. If no initial date is provided, the current date is used.

The minimumDateRangeLength and maximumDateRangeLength properties can be used to limit the length of the selected date range.

The doubleMonth property can be set to true to display two months at a time.

The disabledDates property can be used to disable specific dates.

The quickDateRanges property can be used to display a list of quick selection dateRanges at the top of the picker.

The height property can be used to set the height of the picker.

The theme property can be used to customize the appearance of the picker.

Inheritance

Constructors

DateRangePickerWidget({Key? key, required ValueChanged<DateRange?> onDateRangeChanged, DateTime? initialDisplayedDate, int? minimumDateRangeLength, DateRange? initialDateRange, DateTime? minDate, DateTime? maxDate, CalendarTheme theme = kTheme, int? maximumDateRangeLength, List<DateTime> disabledDates = const [], List<QuickDateRange> quickDateRanges = const [], bool doubleMonth = true, double height = 429, required double leftWidth})
const

Properties

disabledDates List<DateTime>
A list of dates that are disabled and cannot be selected.
final
doubleMonth bool
Set to true to display two months at a time.
final
hashCode int
The hash code for this object.
no setterinherited
height double
The height of the picker.
final
initialDateRange DateRange?
The initial selected date range.
final
initialDisplayedDate DateTime?
The date that is initially displayed when the picker is opened.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
leftWidth double
final
maxDate DateTime?
The latest selectable date.
final
maximumDateRangeLength int?
The maximum length of the selected date range.
final
minDate DateTime?
The earliest selectable date.
final
minimumDateRangeLength int?
The minimum length of the selected date range.
final
onDateRangeChanged ValueChanged<DateRange?>
Called whenever the selected date range is changed.
final
quickDateRanges List<QuickDateRange>
A list of quick selection dateRanges displayed at the top of the picker.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
theme CalendarTheme
The theme used to customize the appearance of the picker.
final

Methods

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