parentOf method

FrameNode? parentOf(
  1. SceneNode node
)

Implementation

FrameNode? parentOf(SceneNode node) {
  FrameNode? search(FrameNode frame) {
    if (frame.children.contains(node)) return frame;
    for (var c in frame.children.whereType<FrameNode>()) {
      var found = search(c);
      if (found != null) return found;
    }
    return null;
  }

  return search(root);
}