Can i Instantiate the treeview and create Project 2
Issue #17
resolved
No description provided.
Comments (4)
-
-
reporter Could you please give me an example
-
List<Node> children = _treeViewController.children; children.add(Node( key: 'us', label: 'US', expanded: true, icon: NodeIcon.fromIconData(Icons.folder), children: [ Node(key: 'us-tn', label: 'Tennessee'), Node(key: 'us-il', label: 'Illinois'), ])); setState(() { _treeViewController = _treeViewController.copyWith(children: children); });
-
- changed status to resolved
Provided user with example
- Log in to comment
Hi Praneeth, I meant to reply earlier. You can absolutely do this. I created the TreeViewController just for this purpose. The controller provides an array of all the nodes. If you add another node (Project 2) to the root of that array and set the children property of the controller to this new array using state management, the tree will be updated with your new value.