Choice<T> class
Represents a selectable choice item.
The key field serves dual purposes:
- Unique identification for validation and selection tracking
- Grouping: if key is null or empty, the choice acts as a group title
Example:
List<Choice<Car>> choices = [
Choice(null, 'Sports Cars'), // Group title
Choice('1', 'Ferrari', metadata: Car(...)),
Choice('2', 'Porsche', metadata: Car(...)),
Choice(null, 'SUVs'), // Another group title
Choice('3', 'Range Rover', metadata: Car(...)),
];
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override