flutter_tree_view icon indicating copy to clipboard operation
flutter_tree_view copied to clipboard

How to show sorted treeview?

Open gslender opened this issue 2 years ago • 1 comments

Do you have any recommendations on how best to add node sorting when displaying the tree view ?

Or is this something you can add so that each node, and children are sorted depending on some node-based sort method ??

gslender avatar Jul 02 '22 01:07 gslender

I didn't really know what I was doing when I wrote the current API. So there's some quirks like sorting that are difficult to do, like for now you would need to remove the children of a node, sort it and add it back...

But the new API I'm working on for v1.0 will be completely customizable (I hope 😅), you will have complete control of the data structures that compose the tree view. The tree will only need some callbacks to operate, like:

List<T> getChildren(T item);
bool getExpansion(T item);
void setExpansion(T item, bool value);

That will hopefully handle all use cases.

baumths avatar Jul 02 '22 11:07 baumths

Since version 1.0 tree nodes are schema-less which should address the sorting issue.

baumths avatar Sep 30 '23 22:09 baumths