collapseNode<K> static method

List<TreeNode<K>> collapseNode<K>(
  1. List<TreeNode<K>> nodes,
  2. TreeNode<K> target
)

Implementation

static List<TreeNode<K>> collapseNode<K>(
    List<TreeNode<K>> nodes, TreeNode<K> target) {
  return replaceNodes(nodes, (node) {
    return node == target ? node.updateState(expanded: false) : null;
  });
}