move method

void move(
  1. RenderNode node,
  2. RenderNode toNode,
  3. int index
)

Implementation

void move(RenderNode node, RenderNode toNode, int index) {
  var viewModel = node.renderViewModel;

  var oldParent = viewModel.parent;
  if (oldParent != null && oldParent is GroupViewModel) {
    oldParent.removeViewModel(viewModel);
  }
  var newParent = toNode.renderViewModel;
  if (newParent is GroupViewModel) {
    newParent.addViewModel(viewModel, index);
  }

  LogUtils.d(
    "ControllerManager",
    "move id: ${node.id} fromId:${oldParent?.id} toId:${newParent.id} ",
  );
}