orderSelectedItems method

void orderSelectedItems()

Keep original Order in selectedItemsList This function is relatively slow, do not use it inside a loop - call it at the end of a loop

Implementation

void orderSelectedItems() {
  var selectedItemsListTemp = HashSet.from(selectedItemsList);
  selectedItemsList.clear();
  for (var item in itemsSource) {
    if (selectedItemsListTemp.contains(item)) {
      selectedItemsList.add(item);
    }
  }
}