subtreeIds<T> static method

List<TreeNodeId> subtreeIds<T>(
  1. TreeNode<T> node
)

All ids beneath (and including) node.

Implementation

static List<TreeNodeId> subtreeIds<T>(TreeNode<T> node) {
  final out = <TreeNodeId>[];
  void rec(TreeNode<T> n) {
    out.add(n.id);
    for (final c in n.children) rec(c);
  }

  rec(node);
  return out;
}