unselectWhere method

void unselectWhere(
  1. bool predicate(
    1. DropdownItem<T> item
    )
)

unselects the items that satisfy the predicate.

The predicate parameter is a function that takes a DropdownItem and returns a boolean.

Implementation

void unselectWhere(bool Function(DropdownItem<T> item) predicate) {
  _selected.removeWhere(predicate);
  notifyListeners();
  _onSelectionChanged?.call(_selectedValues);
}