The expander didn't work
Issue #2
resolved
Hello,
I found that the expander didn't work,It didn’t changed,Please look this:
My code is this:
Comments (3)
-
reporter -
This is, unfortunately, part of the design. The expand/collapse display of the node is driven by the
expanded
property on the node itself. In order for the expander to be updated, you have to update the node in the treeViewController as such:
onExpandNode(String key, bool expanded) { Node node = _treeViewController.getNode(key); if (node != null) { updated = _treeViewController.updateNode(key, node.copyWith(expanded: expanded) ); setState(() { _treeViewController = _treeViewController.copyWith(children: updated); }); } }
-
- changed status to resolved
- Log in to comment
Use version:
flutter_treeview: ^0.2.0+1