controllerForIndex method

NodeController? controllerForIndex(
  1. int index
)

Implementation

NodeController? controllerForIndex(int index) {
  if (this.index == index) {
    return this;
  }

  if (!treeNode.expanded) {
    return null;
  }
  for (NodeController controller in childControllers) {
    var result = controller.controllerForIndex(index);
    if (result != null) {
      return result;
    }
  }
  return null;
}