RangeDatePicker class
Displays a grid of days for a given month and allows the user to select a range of dates.
Days are arranged in a rectangular grid with one column for each day of the week. Controls are provided to change the year and month that the grid is showing.
The range picker widget is rarely used directly. Instead, consider using
showRangeDatePickerDialog
, which will create a dialog that uses this.
See also:
showRangeDatePickerDialog
, which creates a Dialog that contains a RangeDatePicker.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- RangeDatePicker
Constructors
-
RangeDatePicker({Key? key, required DateTime maxDate, required DateTime minDate, ValueChanged<
DateTimeRange> ? onRangeSelected, DateTime? currentDate, DateTime? initialDate, DateTimeRange? selectedRange, EdgeInsets padding = const EdgeInsets.all(16), PickerType initialPickerType = PickerType.days, TextStyle? daysOfTheWeekTextStyle, TextStyle? enabledCellsTextStyle, BoxDecoration enabledCellsDecoration = const BoxDecoration(), TextStyle? disabledCellsTextStyle, BoxDecoration disabledCellsDecoration = const BoxDecoration(), TextStyle? currentDateTextStyle, BoxDecoration? currentDateDecoration, TextStyle? selectedCellsTextStyle, BoxDecoration? selectedCellsDecoration, TextStyle? singelSelectedCellTextStyle, BoxDecoration? singelSelectedCellDecoration, TextStyle? leadingDateTextStyle, Color? slidersColor, double? slidersSize, Color? highlightColor, Color? splashColor, double? splashRadius, bool centerLeadingDate = false, String? previousPageSemanticLabel, String? nextPageSemanticLabel}) - Creates a calendar range picker.
Properties
- centerLeadingDate → bool
-
Centring the leading date. e.g:
final
- currentDate → DateTime?
-
The date to which the picker will consider as current date. e.g (today).
If not specified, the picker will default to today's date.
final
- currentDateDecoration → BoxDecoration?
-
The cell decoration of the current date.
final
- currentDateTextStyle → TextStyle?
-
The text style of the current date.
final
- daysOfTheWeekTextStyle → TextStyle?
-
The text style of the week days name in the header.
final
- disabledCellsDecoration → BoxDecoration
-
The cell decoration of cells which are not selectable.
final
- disabledCellsTextStyle → TextStyle?
-
The text style of cells which are not selectable.
final
- enabledCellsDecoration → BoxDecoration
-
The cell decoration of cells which are selectable.
final
- enabledCellsTextStyle → TextStyle?
-
The text style of cells which are selectable.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- highlightColor → Color?
-
The highlight color of the ink response when pressed.
final
- initialDate → DateTime?
-
The date which will be displayed on first opening. If not specified, the picker
will default to
DateTime.now()
. IfDateTime.now()
does not fall within the valid range of minDate and maxDate, it will automatically adjust to the nearest valid date, selecting maxDate ifDateTime.now()
is after the valid range, or minDate if it is before.final - initialPickerType → PickerType
-
The initial display of the calendar picker.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leadingDateTextStyle → TextStyle?
-
The text style of leading date showing in the header.
final
- maxDate → DateTime
-
The latest date the user is permitted to pick.
final
- minDate → DateTime
-
The earliest date the user is permitted to pick.
final
- nextPageSemanticLabel → String?
-
Semantic label for button to go to the next page.
final
-
onRangeSelected
→ ValueChanged<
DateTimeRange> ? -
Called when the user picks a range.
final
- padding → EdgeInsets
-
The amount of padding to be added around the DatePicker.
final
- previousPageSemanticLabel → String?
-
Semantic label for button to go to the previous page.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedCellsDecoration → BoxDecoration?
-
The cell decoration of selected cells within the range.
final
- selectedCellsTextStyle → TextStyle?
-
The text style of selected cells within the range.
final
- selectedRange → DateTimeRange?
-
The initially selected date range when the picker is first opened.
If the specified range contains the initialDate, that range will be selected.
final
- singelSelectedCellDecoration → BoxDecoration?
-
The decoration for a cell representing:
final
- singelSelectedCellTextStyle → TextStyle?
-
The text style for a cell representing:
final
- slidersColor → Color?
-
The color of the page sliders.
final
- slidersSize → double?
-
The size of the page sliders.
final
- splashColor → Color?
-
The splash color of the ink response.
final
- splashRadius → double?
-
The radius of the ink splash.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< RangeDatePicker> -
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}) → 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