deselectItems method

void deselectItems(
  1. List<T> itemsToDeselect
)

Implementation

void deselectItems(List<T> itemsToDeselect) {
  List<T> newSelectedItems = _selectedItems;
  for (var i in itemsToDeselect) {
    var index = _itemIndexInList(newSelectedItems, i);
    if (index > -1) /*check if the item is already selected*/ {
      newSelectedItems.removeAt(index);
      if (widget.popupProps.onItemRemoved != null) widget.popupProps.onItemRemoved!(_selectedItems, i);
    }
  }
  _selectedItemsNotifier.value = List.from(newSelectedItems);
}