setSelectedItems<K> static method

List<TreeNode<K>> setSelectedItems<K>(
  1. List<TreeNode<K>> nodes,
  2. Iterable<K> selectedItems
)

Implementation

static List<TreeNode<K>> setSelectedItems<K>(
    List<TreeNode<K>> nodes, Iterable<K> selectedItems) {
  return replaceNodes(nodes, (node) {
    if (node is TreeItem<K>) {
      return node.updateState(selected: selectedItems.contains(node.data));
    }
    return null;
  });
}