YaruDateTimeEntry class

A YaruSegmentedEntry configured to accepts and validates a datetime entered by a user.

firstDateTime, lastDateTime, and selectableDateTimePredicate provide constraints on what days are valid. If the input datetime isn't in the datetime range or doesn't pass the given predicate, then the errorInvalidText message will be displayed under the field.

See also:

Inheritance

Constructors

YaruDateTimeEntry({Key? key, YaruDateTimeEntryController? controller, bool includeTime = true, FocusNode? focusNode, DateTime? initialDateTime, required DateTime firstDateTime, required DateTime lastDateTime, bool? force24HourFormat, ValueChanged<DateTime?>? onFieldSubmitted, ValueChanged<DateTime?>? onSaved, ValueChanged<DateTime?>? onChanged, SelectableDateTimePredicate? selectableDateTimePredicate, String? errorFormatText, String? errorInvalidText, bool? autofocus = false, bool? acceptEmpty = true, String? clearIconSemanticLabel})
Creates a YaruDateTimeEntry.
const

Properties

acceptEmpty bool?
Determines if an empty date would show errorFormatText or not.
finalinherited
autofocus bool?
Whether this text field should focus itself if nothing else is already focused.
finalinherited
clearIconSemanticLabel String?
Optional semantic label to add to the clear button icon.
finalinherited
controller IYaruDateTimeEntryController?
A controller that can retrieve parsed DateTime from the input and modify its value.
finalinherited
errorFormatText String?
The error text displayed if the entered date is not in the correct format.
finalinherited
errorInvalidText String?
The error text displayed if the date is not valid.
finalinherited
firstDateTime DateTime
The earliest allowable DateTime that the user can input.
finalinherited
focusNode FocusNode?
Defines the keyboard focus for this widget.
finalinherited
force24HourFormat bool?
finalinherited
hashCode int
The hash code for this object.
no setterinherited
initialDateTime DateTime?
If provided, it will be used as the default value of the field. If null, we must provide a controller.
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lastDateTime DateTime
The latest allowable DateTime that the user can input.
finalinherited
onChanged ValueChanged<DateTime?>?
An optional method to call when the user is changing a value in the field.
finalinherited
onFieldSubmitted ValueChanged<DateTime?>?
An optional method to call when the user indicates they are done editing the text in the field.
finalinherited
onSaved ValueChanged<DateTime?>?
An optional method to call with the final date when the form is saved via FormState.save.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectableDateTimePredicate SelectableDateTimePredicate?
Function to provide full control over which DateTime can be selected.
finalinherited
type → _YaruDateTimeEntryType
finalinherited

Methods

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