New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a lazy SliverTree #114299
Comments
Not quite SliverList, but this would be called something like SliverGroup. I don't believe we've writen it yet. FYI @Piinks if we have a bug for this already |
Thanks for the quick response @jonahwilliams, |
I think there are a lot of options here, and lot of work currently in progress that will help this scenario.
@jonahwilliams is right, a SliverGroup would be good here, if the contents of the SliverGroup are lazy loading, then the entire group will be lazy loading. We're planning on implementing this in the near future, it is being tracked in #33137 cc @thkim1011 However, it sounds like having a Tree builder widget would be more appropriate for this use case - and I am actually working on one right now. 😄 I am adding this issue into the 2D scrolling project for tracking so that I remember to come back and report on the design as it is coming along. There are other related issues there that you may be interested in where folks have shared their own solutions, packages and such while we get closer to finishing the tree widget. SliverList supports box children, and while I don't know what it would look like to support boxes and/or sliver children, it may unnecessarily complicate the API, especially if we have new features on the way that will better support this use case. |
Thanks @Piinks for the detailed information. I think that SliverList supporting both box and slivers as children actually simplifies the API, don't you think? I prefer building my own solutions than using a widget with limited customizations. That is why I suggested to nest a SliverList inside a SliverList, just because it is logical and also easy to use and understand as a developer. Nevertheless, I look forward to see your solutions! |
any update on this? it can help solve many performance issues. |
This cleans up a few sliver classes, like moving RenderSliverVariedExtentList to the rendering layer (it was in the widgets layer), and moving SliverVariedExtentList to live with its sibling subclasses, SliverFixedExtentList, SliverList, and so on. I moved these while working on SliverTree, so figure I should break out into a separate change. SliverTree and SliverCarousel (both inbound in separate changes) will also be subclasses of RenderSliverFixedExtentBoxAdaptor, organizing them together felt easier to work with. Related to #114299 and #125980
This issue is assigned to @Piinks but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks! |
This cleans up a few sliver classes, like moving RenderSliverVariedExtentList to the rendering layer (it was in the widgets layer), and moving SliverVariedExtentList to live with its sibling subclasses, SliverFixedExtentList, SliverList, and so on. I moved these while working on SliverTree, so figure I should break out into a separate change. SliverTree and SliverCarousel (both inbound in separate changes) will also be subclasses of RenderSliverFixedExtentBoxAdaptor, organizing them together felt easier to work with. Related to flutter#114299 and flutter#125980
📜 Design Document
Related:
Use case
Currently when trying to implement tree UIs (for example: comments section with nested comments - see Instagram's comments for reference) there is no way to do it but to flatten the list and use one SliverList to show the data in the UI.
Proposal
Add a way to add a SliverList inside of a SliverList.
This will allow the CustomListView to scroll with all the data while also perform nicely with all the Slivers benefits.
In my use case, this is critical in SliverAnimatedList.
If you have any other solutions I will be happy to discuss.
Solutions I tried
Code example
The text was updated successfully, but these errors were encountered: