getNodeParentsUntilRoot method

List<T> getNodeParentsUntilRoot(
  1. T? node
)

Implementation

List<T> getNodeParentsUntilRoot(T? node) {
  var list = <T>[];

  while (true) {
    var parent = getNodeParent(node);
    if (parent == null) break;
    list.add(parent);
    node = parent;
  }

  return list;
}