deleteNode method
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);
}