traverse method

void traverse(
  1. void action(
    1. TreeNode<Object?>
    )
)

Traverses all the nodes attached to the tree depth first. Calling back action on each node hit.

Implementation

void traverse(void Function(TreeNode) action) {
  for (final node in rootNodes) {
    node.traverse(action);
  }
}