DateTimeField class
Shows an _InputDropdown
that'll trigger DateTimeField._handleTap
whenever the user
clicks on it ! The date picker is platform responsive (ios date picker style for ios, ...)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DateTimeField
Constructors
-
DateTimeField({required ValueChanged<
DateTime?> ? onChanged, Key? key, DateTime? value, VoidCallback? onTap, TextStyle? style, FocusNode? focusNode, bool autofocus = false, bool? enableFeedback, EdgeInsetsGeometry? padding, bool hideDefaultSuffixIcon = false, InputDecoration? decoration, DateTime? initialPickerDateTime, CupertinoDatePickerOptions cupertinoDatePickerOptions = const CupertinoDatePickerOptions(), MaterialDatePickerOptions? materialDatePickerOptions, MaterialTimePickerOptions? materialTimePickerOptions, DateTimeFieldPickerMode mode = DateTimeFieldPickerMode.dateAndTime, DateTime? firstDate, DateTime? lastDate, DateFormat? dateFormat, bool? use24hFormat, @Deprecated(''' enabled has no effect anymore. It gets evaluated from onChanged != null. Will be removed in v5.0.0. ''') bool? enabled, @Deprecated(''' Use value instead. Will be removed in v5.0.0. ''') DateTime? selectedDate, @Deprecated(''' Use style instead. Will be removed in v5.0.0. ''') TextStyle? dateTextStyle, @Deprecated(''' Use onChanged instead. Will be removed in v5.0.0. ''') ValueChanged<DateTime> ? onDateSelected, @Deprecated(''' Use materialDatePickerOptions.initialDatePickerMode instead. Will be removed in v5.0.0 ''') DatePickerMode? initialDatePickerMode, @Deprecated(''' Use materialDatePickerOptions.initialEntryMode instead. Will be removed in v5.0.0 ''') DatePickerEntryMode? initialEntryMode, @Deprecated(''' Use initialPickerDateTime instead. Will be removed in v5.0.0 ''') DateTime? initialDate, @Deprecated(''' Use materialTimePickerOptions.initialEntryMode instead. Will be removed in v5.0.0 ''') TimePickerEntryMode? initialTimePickerEntryMode}) -
DateTimeField.time({Key? key, required ValueChanged<
DateTime?> ? onChanged, DateTime? value, InputDecoration? decoration, DateTime? firstDate, DateTime? lastDate, DateTime? initialPickerDateTime, TextStyle? style, CupertinoDatePickerOptions cupertinoDatePickerOptions = const CupertinoDatePickerOptions(), MaterialTimePickerOptions? materialTimePickerOptions, bool autofocus = false, DateFormat? dateFormat, EdgeInsetsGeometry? padding, VoidCallback? onTap, FocusNode? focusNode, bool hideDefaultSuffixIcon = false, bool? enableFeedback, @Deprecated(''' Use onChanged instead. Will be removed in v5.0.0. ''') ValueChanged<DateTime> ? onDateSelected, @Deprecated(''' Use value instead. Will be removed in v5.0.0. ''') DateTime? selectedDate, @Deprecated(''' enabled has no effect anymore. It gets evaluated from onChanged != null. Will be removed in v5.0.0.''') bool? enabled, @Deprecated(''' Use initialPickerDateTime instead. Will be removed in v5.0.0 ''') DateTime? initialDate, @Deprecated(''' Uses now by default MediaQuery.of(context).alwaysUse24HourFormat. Will be removed in v5.0.0. ''') bool? use24hFormat, @Deprecated(''' Use style instead. Will be removed in v5.0.0. ''') TextStyle? dateTextStyle, @Deprecated(''' Has no effect anymore. Will be removed in v5.0.0 ''') DatePickerEntryMode? initialEntryMode, @Deprecated(''' Use materialTimePickerOptions.initialEntryMode instead. Will be removed in v5.0.0 ''') TimePickerEntryMode? initialTimePickerEntryMode}) -
factory
Properties
- autofocus → bool
-
See Focus.autofocus.
final
- cupertinoDatePickerOptions → CupertinoDatePickerOptions
-
Options to customize the CupertinoDatePicker.
final
- dateFormat → DateFormat
-
The format of the shown DateTime.
final
- decoration → InputDecoration?
-
The decoration to show around the formatted DateTime.
final
- enableFeedback → bool?
-
See InkWell.enableFeedback.
final
- firstDate → DateTime
-
The first DateTime the user can select.
final
- focusNode → FocusNode?
-
See Focus.autofocus.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hideDefaultSuffixIcon → bool
-
Hides the default suffix icon.
final
- initialPickerDateTime → DateTime?
-
The initial DateTime in the pickers, when no DateTime is selected.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- lastDate → DateTime
-
The last DateTime the user can select.
final
- materialDatePickerOptions → MaterialDatePickerOptions
-
Options to customize the
MaterialDatePicker
.final - materialTimePickerOptions → MaterialTimePickerOptions
-
Options to customize the
MaterialTimePicker
.final - mode → DateTimeFieldPickerMode
-
The mode of the DateTimeField.
final
-
onChanged
→ ValueChanged<
DateTime?> ? -
A callback that gets executed when the user changes the DateTime in the DateTimeField.
final
- onTap → VoidCallback?
-
A callback that gets executed when the user taps on the DateTimeField and before the
pickers are shown.
final
- padding → EdgeInsetsGeometry?
-
Padding around the visible portion of the DateTimeField widget.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → TextStyle?
-
The text style to use for text in the DateTimeField.
final
- use24hFormat → bool?
-
final
- value → DateTime?
-
The DateTime that represents the currently selected date.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< DateTimeField> -
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