Dynamically generate tree
Issue #7
resolved
Hi! First off, I love how this Widget works! Thank you so much!
I initialize the controller in my didChangeDependencies()
like this:
_treeViewController = TreeViewController(
children: [
Node(
label: 'Location',
key: 'location',
),
],
);
But for some reason Iām not able to dynamically add items to it from my stream:
_treeViewController.addNode('location', Node(key: 'id0', label: 'Sub location name'));
Am I missing something? Would love to hear from you
Comments (3)
-
-
- changed status to resolved
-
reporter Thanks for the clarification, everything is working as expected now! Thanks for this great widget!
- Log in to comment
Hi, you are very close in your implementation but the addNode method only returns a new list object:
You have to explicitly set the state yourself to see an update.
Somewhere in your code you should add the following statement where the state will be updated:
ā
ā