allOf static method
Every variants component on root and its subtree, in breadth-first
order. Select on each to switch a multi-root model completely.
Implementation
static List<MaterialsVariantsComponent> allOf(Node root) {
final found = <MaterialsVariantsComponent>[
...root.getComponents<MaterialsVariantsComponent>(),
];
final queue = <Node>[...root.children];
for (var i = 0; i < queue.length; i++) {
found.addAll(queue[i].getComponents<MaterialsVariantsComponent>());
queue.addAll(queue[i].children);
}
return found;
}