leafIds<T> static method

List<NavNodeId> leafIds<T>(
  1. NavNode<T> node
)

All leaf ids beneath (and including, if leaf) node.

Implementation

static List<NavNodeId> leafIds<T>(NavNode<T> node) {
  final out = <NavNodeId>[];
  void rec(NavNode<T> n) {
    if (n.isLeaf) {
      out.add(n.id);
    } else {
      for (final c in n.children) rec(c);
    }
  }

  rec(node);
  return out;
}