MinimalNumberField class
Bounded integer adjustment — guests, servings, pages, sets: a compact bordered 32 px control of − · value · +, the value in mono with tabular figures so the box never changes width as it counts. The parent owns the value.
Hold a button to repeat. A button whose way is blocked by min or max
disables itself; a null onChanged dims the whole control. Each button
is a focus stop that Enter or Space presses, and announces the value with
its action (Increase Guests, 3). format prints the figure (3×,
1.5) and unit names what it counts (pages): the figure stays in
mono and the word after it prints in Geist, the way a field's suffix
does, and a screen reader hears both (20 pages). Never put the word in
format — it would print in mono. The value slot keeps one steady
width, room for three figures and a short unit, so steppers stacked in a
form line up, with a unit or without; only a wider value in range grows
it. The hit area pads out to 44 whatever the control paints.
MinimalNumberField(value: pages, min: 5, max: 50, step: 5, unit: 'pages', label: 'Pages', onChanged: setPages)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MinimalNumberField
Constructors
Properties
- format → String Function(int)?
-
How the figure prints; plain digits when omitted. Figures and symbols
only (
3×): a word goes in unit.final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String?
-
What is being counted, for the buttons' announcements.
final
- max → int
-
The most it goes to.
final
- min → int
-
The least it goes to.
final
-
onChanged
→ ValueChanged<
int> ? -
Null disables the stepper.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- step → int
-
How much a press changes it.
final
- unit → String?
-
The word after the figure (
pages,min,glasses), printed in the body face and announced with the value.final - value → int
-
The number it shows.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MinimalNumberField> -
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