removeChild method

void removeChild(
  1. Node child
)

Remove child from this node's list of children. If this node is child's parent, child.parent will be set to null.

Implementation

void removeChild(Node child) {
	// update this node
	if (_children.contains(child)) {
		_children.remove(child);
	}
	// update child
	if (child.parent == this) {
		child.parent = null;
	}
}