toggleExpansion method

void toggleExpansion()

Implementation

void toggleExpansion() {
  tree.data.isExpanded = !tree.data.isExpanded;
  tree.data.isExpanded
      ? rotationController.forward()
      : rotationController.reverse();
}