updateChildren abstract method
Creates a new instance with updated children list.
Returns a new TreeNode instance with the specified children while preserving all other properties including state. Used for structural modifications.
Parameters:
children
(List<TreeNode
Returns: A new TreeNode<T>
instance with updated children
Example:
List<TreeNode<String>> newChildren = [TreeItem(data: 'new_child')];
TreeNode<String> updated = node.updateChildren(newChildren);
Implementation
TreeNode<T> updateChildren(List<TreeNode<T>> children);