optionGroups property

  1. @override
List<OptionGroup<T>> get optionGroups
inherited

The groups of available options.

Do not modify this list from outside of this class. Instead, create a SelectionOptions from a stream. This list may be replaced by the data provider, so consider this list reference to be ephemeral, with the SelectionOptions object's property as the source of truth.

Implementation

@override
List<OptionGroup<T>> get optionGroups => _optionGroups;
  1. @override
set optionGroups (List<OptionGroup<T>> value)
override

Implementation

@override
set optionGroups(List<OptionGroup<T>> value) {
  // This mutates value...
  if (_shouldSort) {
    value.forEach((optionGroup) {
      optionGroup.sort(_sortFn);
    });
  }
  // Cache the data so original is kept during filtering.
  _optionGroups = value;
  super.optionGroups = value;
  if (filterApplied) {
    refilter();
  }
}