toggleSelectNodes<K> static method

List<TreeNode<K>> toggleSelectNodes<K>(
  1. List<TreeNode<K>> nodes,
  2. Iterable<TreeNode<K>> targets
)

Implementation

static List<TreeNode<K>> toggleSelectNodes<K>(
    List<TreeNode<K>> nodes, Iterable<TreeNode<K>> targets) {
  return replaceNodes(nodes, (node) {
    return targets.contains(node)
        ? node.updateState(selected: !node.selected)
        : null;
  });
}