deleteNode method
void
deleteNode(
- int instanceId,
- int id
)
Implementation
void deleteNode(int instanceId, int id) {
var uiNode = controllerManager.findNode(instanceId, id);
if (uiNode != null) {
uiNode.isDelete = true;
var parent = uiNode.parent;
if (parent != null) {
if (uiNode.shouldCreateView) {
_uiUpdateNodes.remove(uiNode);
} else {
parent.addDeleteId(id);
addUpdateNodeIfNeeded(parent);
}
} else if (uiNode.isRoot) {
addUpdateNodeIfNeeded(uiNode);
}
_deleteSelfFromParent(uiNode);
LogUtils.dRender("ID:$id, delete node success");
} else {
LogUtils.dRender("ID:$id, delete node error, node not found");
}
}