TermToggleGroup<T> class
Toggles in one pair of brackets, [ list │ tiles │ log ], each chosen
one in inverse video: one choice (multiSelectionEnabled false, a
segmented control) or each on its own (a toggle group). The arrows move
along it; Space and Return press.
TermToggleGroup<String>(
options: const ['list', 'tiles'],
selected: {view},
labelOf: (v) => v,
onSelectionChanged: (s) => setState(() => view = s.first),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- TermToggleGroup
Constructors
-
TermToggleGroup({Key? key, required List<
T> options, required Set<T> selected, required ValueChanged<Set< ? onSelectionChanged, required String labelOf(T value), bool multiSelectionEnabled = false, bool emptySelectionAllowed = false, bool selectFollowsFocus = false, bool isEnabled(T value)?, String? semanticLabel, TermStyle? style})T> > -
Toggles over
options.const
Properties
- emptySelectionAllowed → bool
-
Whether the last chosen one may be pressed off.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEnabled → bool Function(T value)?
-
Whether an option can be pressed; null: every one.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- labelOf → String Function(T value)
-
The words for an option.
final
- multiSelectionEnabled → bool
-
Whether each toggles on its own.
final
-
onSelectionChanged
→ ValueChanged<
Set< ?T> > -
Called with the new choice; null disables the group.
final
-
options
→ List<
T> -
The choices, in order.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selected
→ Set<
T> -
The chosen ones.
final
- selectFollowsFocus → bool
-
Whether the arrows choose as they move (a segmented control).
final
- semanticLabel → String?
-
What a screen reader calls the group.
final
- style → TermStyle?
-
Overrides, over the theme's TermThemeData.toggleGroupStyle:
fill(the chosen cells),foreground(the words) andedge(the brackets).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