flutter_tree_view
flutter_tree_view copied to clipboard
How to show sorted treeview?
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 ??
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.
Since version 1.0 tree nodes are schema-less which should address the sorting issue.