ChoiceConfigKnob<T> class

A ConfigKnob for selecting one of multiple options.

This is a useful choice for selecting one of an enum.

Inheritance
Implementers

Constructors

ChoiceConfigKnob(List<T> choices, {required T value, Map<T, String> choiceLabels = const {}})
Creates a new knob to with the specified default value of the available choices.

Properties

choiceLabels → Map<T, String>
Stable labels used for both display and JSON serialization.
final
choices ↔ List<T>
The available choices to choose from.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value ↔ T
The primary value being stored in this knob.
getter/setter pairinherited-getteroverride-setter

Methods

labelFor(T choice) → String
Returns the user-facing label for choice.
loadJson(Map<String, dynamic> decodedJson) → void
Reconfigures this knob based on the provided deserialized JSON.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this knob into a JSON-compatible map.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited