changeParent method

void changeParent(
  1. Component component
)

Changes the current parent for another parent and prepares the tree under the new root.

Implementation

void changeParent(Component component) {
  parent?.remove(this);
  nextParent = component;
}