StringSelectionOptions<T> class

The class is meant to be used in areas where a selection can be represented as a string.

Example usage:

class Color {
  final int colorId;
  final String displayName;

  Color(this.colorId, this.displayName);
}

var options = new StringSelectionOptions<Color>(
    // list of colors
    [new Color (1, 'Red'), new Color(2, 'Blue'), new Color(3, 'Purple')],
    toFilterableString: (Color color) => color.displayName.toLowerCase());
Inheritance
Implemented types
Implementers

Constructors

StringSelectionOptions(List<T> options, {ItemRenderer<T>? toFilterableString, StringSuggestionFilter<T>? suggestionFilter, ItemRenderer<String> sanitizeString = _stringFormatSuggestion, bool shouldSort = false, bool shouldFilterEmpty = true})
The list of options and optionally a function to convert the option into a string that can be used for filtering the list.
StringSelectionOptions.withOptionGroups(List<OptionGroup<T>> optionGroups, {ItemRenderer<T>? toFilterableString, StringSuggestionFilter<T>? suggestionFilter, ItemRenderer<String> sanitizeString = _stringFormatSuggestion, bool shouldSort = false, bool shouldFilterEmpty = true})

Properties

currentLimit int?
Max number of items requested on the last call to filter.
no setteroverride
currentQuery Object?
The query passed in on the last call to filter.
no setteroverride
filterApplied bool
no setter
hashCode int
The hash code for this object.
no setterinherited
isNotEmpty bool
TODO(google): Remove method after b/26784290 is resolved.
no setterinherited
optionGroups List<OptionGroup<T>>
The groups of available options.
getter/setter pairinherited-getteroverride-setter
optionsList List<T>
All options flattened in one list.
no setterinherited
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 setterinherited
unfilteredOptionGroups List<OptionGroup<T>>?
no setter

Methods

dispose() → void
Dispose when the the options come from a stream.
inherited
filter(Object query, {int? limit = -1}) DisposableFuture<bool>
Accepts a string query and limit and applies the filter to the options.
override
filterOption(T option, String filterQuery) bool
filterOptionGroup(OptionGroup<T> group, String filterQuery, int limit) OptionGroup<T>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refilter() → void
toString() String
A string representation of this object.
inherited

Operators

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

Constants

UNLIMITED → const int
Unlimited large value to support no limit for filtering.