removeChild method

void removeChild(
  1. TreeNode child
)

Removes a single child from this node and set its parent to null.

Implementation

void removeChild(TreeNode child) {
  final wasRemoved = _children.remove(child);

  if (wasRemoved) {
    child._parent = null;
  }
}