removeItem method

void removeItem(
  1. dynamic item
)

remove

Implementation

void removeItem(dynamic item) {
  dynamic temp = parentOfItem(item);
  NodeData? parent = temp;
  int index = 0;
  if (parent == null) {
    index = data!.indexOf(item);
    data!.remove(item);
  } else {
    index = parent.children.indexOf(item);
    parent.children.remove(item);
  }

  removeItemAtIndexes(index, parent);

  notifyListeners();
}