getChildByIndexPath method

Node? getChildByIndexPath(
  1. Iterable<int> indexPath
)

Returns the child node at the specified index path.

Implementation

Node? getChildByIndexPath(Iterable<int> indexPath) {
  Node? current = this;
  for (var index in indexPath) {
    if (index < 0 || index >= current!.children.length) {
      return null;
    }
    current = current.children[index];
  }
  return current;
}