ExpressiveNumberField class

A whole-number quantity between two tonal icon buttons, − and +: a cart line, guests, servings. Holding a button repeats; each button disables at its bound. format shows the value (a unit, a price); label names the quantity to a screen reader ("Increase Guests").

ExpressiveNumberField(value: guests, min: 1, max: 8, label: 'Guests', onChanged: (v) => setState(() => guests = v))
Inheritance

Constructors

ExpressiveNumberField({required int value, required ValueChanged<int>? onChanged, ExpressiveComponentThemeData? style, int min = 0, int max = 99, int step = 1, String? label, String format(int value)?, Key? key})
A quantity stepper at value between min and max, reporting a change through onChanged.
const

Properties

enabled → bool
Whether it takes input: false when onChanged is null, as in Flutter.
no setter
format → String Function(int value)?
How the value reads; its decimal digits when null.
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 the quantity is, for a screen reader (the strings' quantity when null).
final
max → int
The largest quantity.
final
min → int
The smallest quantity.
final
onChanged → ValueChanged<int>?
Called with each new quantity; null disables the stepper.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
step → int
How far one press moves.
final
style → ExpressiveComponentThemeData?
Stateful visual overrides for the buttons and value.
final
value → int
The current quantity.
final

Methods

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