SelectionOptions<T> class

Holds a list of options for a selection-based component.

The options are organized into OptionGroups. The underlying options may be async and resolved by a Future or updated using a Stream.

SelectionOptions supports a simple form of the Observable pattern that will fire a change notification when the optionGroups list changes but it will not detect if the contents of the List or the individual OptionGroups changed.

Inheritance
Implemented types
Implementers

Constructors

SelectionOptions(List<OptionGroup<T>> optionGroups)
Creates an instance with the given option groups.
SelectionOptions.fromFuture(Future<List<OptionGroup<T>>> optionGroupListFuture)
Creates an instance with options resolved from the provided Future.
factory
SelectionOptions.fromList(List<T> options, {String? label})
Creates an instance from a list of options.
SelectionOptions.fromStream(Stream<List<OptionGroup<T>>> optionGroupListStream)
Creates an instance where the available options are the last data item from the provided Stream.
factory
SelectionOptions.withOptionGroups(List<OptionGroup<T>> optionGroups)
Creates an instance with the given option groups.

Properties

hashCode int
The hash code for this object.
no setterinherited
isNotEmpty bool
TODO(google): Remove method after b/26784290 is resolved.
no setter
optionGroups List<OptionGroup<T>>
The groups of available options.
getter/setter pairoverride
optionsList List<T>
All options flattened in one list.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<List<OptionGroup<T>>>
Provides the stream of options group changes.
no setteroverride

Methods

dispose() → void
Dispose when the the options come from a stream.
override
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.
inherited