toggleSelectItem<K> static method
Implementation
static List<TreeNode<K>> toggleSelectItem<K>(
List<TreeNode<K>> nodes, K target) {
return replaceNodes(nodes, (node) {
if (node is TreeItem<K> && node.data == target) {
return node.updateState(selected: !node.selected);
}
return null;
});
}