Retain collapsed / expanded state.
Opened this issue · 2 comments
phimath commented
I'm using the latest master branch. Is there anyway to store the state of which children are expanded?
When I navigate away and back the treeview always rebuilds and resets this.
sasam0502 commented
Hi, I am using the library too and it would be really great if the expanded state would be remembered.
sasam0502 commented
I found a solution:
Copy the tree_view.dart and add it locally. In class class TreeViewChildState in build method change AnimatedSize to:
AnimatedSize( curve: Curves.easeIn, duration: const Duration(milliseconds: 400), child:Offstage ( offstage: !isExpanded!, child: Column( mainAxisSize: MainAxisSize.min, children: widget.children, ), ), ),