searchNodeSubtree static method

dynamic searchNodeSubtree(
  1. dynamic children,
  2. dynamic nodeName
)

Implementation

static searchNodeSubtree(children, nodeName) {
  for (var i = 0; i < children.length; i++) {
    var childNode = children[i];

    if (childNode.name == nodeName || childNode.uuid == nodeName) {
      return childNode;
    }

    var result = searchNodeSubtree(childNode.children, nodeName);

    if (result != null) return result;
  }

  return null;
}