nodeTreeContainsAny function

bool nodeTreeContainsAny(
  1. Node rootNode,
  2. Iterable<Node> list
)

Returns true if rootNode contains any Node in list.

Implementation

bool nodeTreeContainsAny(Node rootNode, Iterable<Node> list) {
  if (list.isEmpty) return false;
  return list.firstWhereOrNull((e) => e == rootNode || rootNode.contains(e)) !=
      null;
}