StringSelectionOptions<T> constructor

StringSelectionOptions<T>(
  1. List<T> options, {
  2. ItemRenderer<T>? toFilterableString,
  3. StringSuggestionFilter<T>? suggestionFilter,
  4. ItemRenderer<String> sanitizeString = _stringFormatSuggestion,
  5. bool shouldSort = false,
  6. 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.

The options must be either strings or convertible to strings using an optional ItemRenderer that is passed in. If no ItemRenderer is passed in, _stringFormatSuggestion will be used.

If the data needs to be sorted, it should be passed in sorted. The option shouldSort is a simple way to apply the default sorting rules.

Set shouldFilterEmpty to false if filter should return empty when the query is empty.

Implementation

StringSelectionOptions(List<T> options,
    {ItemRenderer<T>? toFilterableString,
    StringSuggestionFilter<T>? suggestionFilter,
    ItemRenderer<String> sanitizeString = _stringFormatSuggestion,
    bool shouldSort = false,
    bool shouldFilterEmpty = true})
    : this.withOptionGroups([OptionGroup(options)],
          toFilterableString: toFilterableString,
          suggestionFilter: suggestionFilter,
          sanitizeString: sanitizeString,
          shouldSort: shouldSort,
          shouldFilterEmpty: shouldFilterEmpty);