StudioToggleBank<T> class

Latching keys in a recessed bank: a key pressed stays down with its own lamp lit until it is pressed again. Several may be in at once unless multiSelectionEnabled is false; then the bank is one choice, read as a radio group. Given iconOf, each key shows its glyph and labelOf names it to a screen reader.

Built on ui_core's DesignToggleGroup: the arrows move along the bank, Space and Enter press. A null onSelectionChanged disables it.

Reads style's fill, foreground, minimumSize and textStyle for each key, in its states (selected while latched), then StudioThemeData.toggleBankStyle.

StudioToggleBank<String>(options: const ['Mute', 'Solo'], selected: on, labelOf: (s) => s, onSelectionChanged: (next) => setState(() => on = next))
Inheritance

Constructors

StudioToggleBank({Key? key, required List<T> options, required Set<T> selected, required ValueChanged<Set<T>>? onSelectionChanged, required String labelOf(T value), Widget iconOf(T value)?, bool multiSelectionEnabled = true, bool emptySelectionAllowed = true, bool isEnabled(T value)?, String? semanticLabel, StudioStyle? style})
A bank over options, selected latched in.
const

Properties

emptySelectionAllowed → bool
Whether every key may be out.
final
hashCode → int
The hash code for this object.
no setterinherited
iconOf → Widget Function(T value)?
Each key's glyph; null shows legends.
final
isEnabled → bool Function(T value)?
Whether value's key may be pressed.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
labelOf → String Function(T value)
Each key's legend (its name, when it shows a glyph).
final
multiSelectionEnabled → bool
Whether several keys may be in at once.
final
onSelectionChanged → ValueChanged<Set<T>>?
Called with the next set; null disables the bank.
final
options → List<T>
The keys' values, in order.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selected → Set<T>
The values latched in.
final
semanticLabel → String?
What a screen reader calls the bank.
final
style → StudioStyle?
Each key's style, over StudioThemeData.toggleBankStyle.
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.
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