findParentNode static method
- ElectricalNode? root,
- String childId
Find parent of a node
Implementation
static ElectricalNode? findParentNode(
ElectricalNode? root,
String childId,
) {
if (root == null) return null;
return root.map(
source: (node) => _findParentInChildren(node, node.children, childId),
protection: (node) => _findParentInChildren(node, node.children, childId),
panel: (node) => _findParentInChildren(node, node.children, childId),
load: (_) => null,
);
}