withDeleteNode<T> method
Null safety
Removes an existing node identified by specified key. It returns a new controller with the node removed. This method expects the user to properly place this call so that the state is updated.
See TreeViewController.deleteNode for info on optional parameters.
setState((){
controller = controller.withDeleteNode(key);
});
Implementation
TreeViewController withDeleteNode<T>(String key, {Node? parent}) {
List<Node> _data = deleteNode<T>(key, parent: parent);
return TreeViewController(
children: _data,
selectedKey: this.selectedKey,
);
}