copyWith method

TreeViewController<T> copyWith({
  1. List<Node<T>>? children,
  2. String? selectedKey,
})

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,
  );
}