copyWith method
Creates a copy of this controller but with the given fields replaced with the new values.
Implementation
TreeViewController<T> copyWith(
{List<Node<T>>? children, String? selectedKey}) {
return TreeViewController<T>(
children: children ?? this.children,
selectedKey: selectedKey ?? this.selectedKey,
);
}