expandNode method

void expandNode(
  1. TreeNode<D> node
)

Implementation

void expandNode(TreeNode<D> node) {
  if (node.hasChildren) {
    // Collapse rings up to the clicked expanded node.
    if (node.children.any(_nodeToExpand.contains)) {
      node.visit((e) {
        if (node != e) {
          _nodeToExpand.remove(e);
        }
      });
    } else {
      // Expand clicked node by one level.
      _nodeToExpand
        ..add(node)
        ..addAll(node.children);
    }
  }
}