expandAndExpandChildren method

void expandAndExpandChildren(
  1. bool expandChildren
)

Collapsing and expanding

Implementation

void expandAndExpandChildren(bool expandChildren) {
  for (NodeController controller in childControllers) {
    controller.resetData();
  }

  treeNode.setExpanded = true;
  resetData();

  /// Recursively expand all child nodes
  for (NodeController controller in childControllers) {
    if (controller.treeNode.expanded || expandChildren) {
      controller.expandAndExpandChildren(expandChildren);
    }
  }

  parent!.resetNodesAfterChildAtIndex(parent!.childControllers.indexOf(this));
}