YaruTimeEntry class
A YaruSegmentedEntry configured to accepts and validates a time entered by a user.
firstTime, lastTime, and selectableTimeOfDayPredicate provide constraints on what days are valid. If the input date isn't in the date range or doesn't pass the given predicate, then the errorInvalidText message will be displayed under the field.
Under the hood, this widget is a simple adapter that converts TimeOfDay objects into DateTime.
See also:
- YaruDateTimeEntry, a similar widget which accepts date and time input.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- YaruTimeEntry
Constructors
-
YaruTimeEntry({Key? key, YaruTimeEntryController? controller, FocusNode? focusNode, TimeOfDay? initialTimeOfDay, TimeOfDay? firstTime, TimeOfDay? lastTime, bool? force24HourFormat, ValueChanged<
TimeOfDay?> ? onFieldSubmitted, ValueChanged<TimeOfDay?> ? onSaved, ValueChanged<TimeOfDay?> ? onChanged, SelectableTimeOfDayPredicate? selectableTimeOfDayPredicate, String? errorFormatText, String? errorInvalidText, bool? autofocus, bool? acceptEmpty}) -
Creates a YaruTimeEntry.
const
Properties
- acceptEmpty → bool?
-
Determines if an empty date would show errorFormatText or not.
final
- autofocus → bool?
-
Whether this text field should focus itself if nothing else is already
focused.
final
- controller → YaruTimeEntryController?
-
A controller that can retrieve parsed TimeOfDay from the input and modify its value.
final
- errorFormatText → String?
-
The error text displayed if the entered date is not in the correct format.
final
- errorInvalidText → String?
-
The error text displayed if the date is not valid.
final
- firstTime → TimeOfDay?
-
The earliest allowable TimeOfDay that the user can input.
final
- focusNode → FocusNode?
-
Defines the keyboard focus for this widget.
final
- force24HourFormat → bool?
-
If true, the hour will use the 24-hour format regardless of the ambient format.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialTimeOfDay → TimeOfDay?
-
If provided, it will be used as the default value of the field.
If null, we must provide a controller.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- lastTime → TimeOfDay?
-
The latest allowable TimeOfDay that the user can input.
final
-
onChanged
→ ValueChanged<
TimeOfDay?> ? -
An optional method to call when the user is changing a value in the field.
final
-
onFieldSubmitted
→ ValueChanged<
TimeOfDay?> ? -
An optional method to call when the user indicates they are done editing
the text in the field.
final
-
onSaved
→ ValueChanged<
TimeOfDay?> ? -
An optional method to call with the final date when the form is
saved via FormState.save.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectableTimeOfDayPredicate → SelectableTimeOfDayPredicate?
-
Function to provide full control over which TimeOfDay can be selected.
final
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.
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