deleteNode method

void deleteNode(
  1. int id
)

Implementation

void deleteNode(int id) {
  VirtualNode? node = _virtualNodes[id];
  if (node == null) {
    return;
  }
  node.onDelete();
  node._parent?.removeChild(node);
  node._parent = null;
  for (var child in node._children) {
    deleteNode(child.id);
  }
  node._children.clear();
  _virtualNodes.remove(id);
}