findChildNodes function
Get the child nodes of a given lookup path. If multiple nodes have the same name, all their children will be returned.
Implementation
List<Node> findChildNodes(List<Node> nodes, List<String> path) {
if (path.isEmpty) {
return nodes;
}
final head = path.first;
final tail = path.sublist(1);
return nodes
.where((node) => (node as dynamic).name == head)
.expand((node) => findChildNodes(getNodeChildren(node), tail))
.toList();
}