DatePicker class

The date picker gives you a standardized way to let users pick a localized date value using touch, mouse, or keyboard input.

DatePicker Preview

See also:

Inheritance
Available extensions

Constructors

DatePicker({Key? key, required DateTime? selected, ValueChanged<DateTime>? onChanged, VoidCallback? onCancel, String? header, TextStyle? headerStyle, bool showDay = true, bool showMonth = true, bool showYear = true, DateTime? startDate, DateTime? endDate, EdgeInsetsGeometry contentPadding = kPickerContentPadding, double popupHeight = kPickerPopupHeight, FocusNode? focusNode, bool autofocus = false, Locale? locale, List<DatePickerField>? fieldOrder, List<int>? fieldFlex})
Creates a date picker.

Properties

autofocus bool
True if this widget will be selected as the initial focus when no other node in its scope is currently focused.
final
contentPadding EdgeInsetsGeometry
The padding of the picker fields. Defaults to kPickerContentPadding
final
endDate DateTime
The date displayed at the end of the list
final
fieldFlex List<int>?
The flex of the fields.
final
fieldOrder List<DatePickerField>?
The order of the fields.
final
focusNode FocusNode?
An optional focus node to use as the focus node for this widget.
final
hashCode int
The hash code for this object.
no setterinherited
The content of the header
final
headerStyle TextStyle?
The style of the header
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
locale Locale?
The locale used to format the month name.
final
onCancel VoidCallback?
Whenever the user cancels the date change.
final
onChanged ValueChanged<DateTime>?
Whenever the current selected date is changed by the user.
final
popupHeight double
The height of the popup.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selected DateTime?
The current date selected date.
final
showDay bool
Whenever to show the day field
final
showMonth bool
Whenever to show the month field
final
showYear bool
Whenever to show the year field
final
startDate DateTime
The date displayed at the beggining
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<DatePicker>
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.
override
getProperty<T>([dynamic def]) → T?

Available on Widget, provided by the ItemExtension extension

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