updateRecursiveSelection<K> static method
Updates selection state to maintain parent-child consistency.
Parameters:
nodes(List<TreeNode<K>>, required): Tree nodes.
Returns: List<TreeNode<K>> — tree with updated selection.
Implementation
static List<TreeNode<K>> updateRecursiveSelection<K>(
List<TreeNode<K>> nodes) {
return replaceNodesWithParent(nodes, (parent, node) {
if (node is TreeItemNode<K> &&
!node.selected &&
parent != null &&
parent.selected) {
return node.updateState(selected: true);
}
return null;
});
}