DateTimeFormField class

A date time pick form field widget.

Inheritance

Constructors

DateTimeFormField({@required DateTime initialValue, @required String label, DateFormat formatter, FormFieldSetter<DateTime> onSaved, FormFieldValidator<DateTime> validator, bool autovalidate: false, bool enabled: true, bool onlyDate: false, bool onlyTime: false, DateTime firstDate, DateTime lastDate})
Create a DateTimeFormField. The onlyDate and onlyTime arguments can not be set to true at the same time.

Properties

autovalidate bool
Whether validate every time, default value is false.
final
enabled bool
final
firstDate DateTime
The first date time of picking, default value is 'DateTime(1970)'.
final
formatter DateFormat
The format of displaying date time in form field, default value is 'DateFormat("EE, MMM d, yyyy h:mma")' in date and time mode, 'DateFormat("EEE, MMM d, yyyy")' in date only mode, 'DateFormat("h:mm a") in time only mode.
final
initialValue DateTime
The initial date time, default value is 'DateTime.now()'.
final
label String
The label of form field, default value is 'Date Time'.
final
lastDate DateTime
The last date time of picking, default value is 'DateTime(2100)'.
final
onlyDate bool
Only show and edit date, default value is false.
final
onlyTime bool
Only show and edit time, default value is false. onlyDate and onlyTime cannot be set to true at the same time.
final
onSaved FormFieldSetter<DateTime>
Save value function of form field.
final
validator FormFieldValidator<DateTime>
Validate function of form field.
final
hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget. [...]
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree. [...]
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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
Returns 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. [...]
@nonVirtual, inherited