DesignTimeField class

A time of day typed in segments, on the reader's clock: value the time, null when empty; onChanged gets it once every segment holds one, and null when one is cleared.

The segments follow DesignLocalizations.timeFieldPattern: hour, minute and AM/PM in English; a 24-hour clock in German, or wherever alwaysUse24HourFormat (by default the platform's setting, MediaQuery.alwaysUse24HourFormatOf) says so; seconds when showSeconds. AM/PM takes the first letter of either word, and Up and Down swap it. The keys are DesignDateField's.

DesignTimeField(value: const DesignTimeOfDay(hour: 9, minute: 30), onChanged: (time) {}, segmentBuilder: (context, details) => Text(details.text))
Inheritance

Constructors

DesignTimeField({Key? key, required DesignTimeOfDay? value, required ValueChanged<DesignTimeOfDay?>? onChanged, required DesignDateSegmentBuilder segmentBuilder, DesignDateLiteralBuilder? literalBuilder, DesignDateFieldFrameBuilder? frameBuilder, bool showSeconds = false, bool? alwaysUse24HourFormat, String? semanticLabel, bool autofocus = false, VoidCallback? onEditingComplete})
A time field showing value.
const

Properties

alwaysUse24HourFormat → bool?
Whether the clock runs 0–23 with no AM/PM; null: the platform's setting where it is on, else the locale's clock.
final
autofocus → bool
Whether the first segment takes focus when it first shows.
final
frameBuilder → DesignDateFieldFrameBuilder?
Frames the laid-out segments; null: the segments alone.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
literalBuilder → DesignDateLiteralBuilder?
Paints the text between segments; null: a Text.
final
onChanged → ValueChanged<DesignTimeOfDay?>?
Called with the time once every segment holds one, and with null when a segment is cleared.
final
onEditingComplete → VoidCallback?
Called on Enter (and a phone keyboard's Done).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
segmentBuilder → DesignDateSegmentBuilder
Paints a segment.
final
semanticLabel → String?
What a screen reader calls the field ("Start time"); null: nothing.
final
showSeconds → bool
Whether it has a seconds segment. Defaults to false.
final
value → DesignTimeOfDay?
The time shown; null, empty.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<DesignTimeField>
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
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