recombineNode method
用于跨父节点移动子节点
Implementation
void recombineNode(
int instanceId,
List<int> moveIds,
int oldPId,
int moveIndex,
int newPId,
) {
var parentNode = controllerManager.findNode(instanceId, oldPId);
var newParent = controllerManager.findNode(instanceId, newPId);
if (parentNode != null && newParent != null) {
var arrayList = <RenderNode>[];
var i = 0;
for (var moveId in moveIds) {
var renderNode = controllerManager.findNode(instanceId, moveId);
if (renderNode != null) {
LogUtils.dRender(
"ID:$moveId, move node ID:$moveId from ${parentNode.id} to ${newParent.id}",
);
arrayList.add(renderNode);
parentNode.removeChild(renderNode, needRemoveChild: false);
newParent.addChild(renderNode, i + moveIndex);
i++;
}
}
parentNode.move(arrayList, newParent);
addUpdateNodeIfNeeded(newParent);
}
}