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
Feature request: MultiSliver.builder #44
Comments
Can you elaborate on what you would expect a MultiSliver.builder to be? |
I think he is suggesting to add an option to also provide a sliver builder function instead of the children argument. This is sometimes preferred, or even necessary, as the number of children grows since instantiating all children on the first build can be very expensive or even impossible in case of an infinite list. With a builder each child is only instantiated once it needs to be painted. (Similar to SliverChildListDelegate vs. SliverChildBuilderDelegate) |
@LucasAschenbach thanks for attempting to clarify, however that part I understood. I should have been a bit clearer in my question. The question I meant was: How would you expect a MultiSliver.builder to work. Because slivers are always built since their position in the list doesn’t necessarily mean that they will be drawn after the item before it. For instance, sticky headers work because they always get the chance to layout even if they are way earlier in the list. |
We can close 😁 |
Same as it is but with a builder pattern, like Listview.builder.
it's possible I am missing a part of the puzzle and what I want to achieve
is not possible like that :')
…On Fri, Mar 11, 2022 at 9:19 PM Pieter van Loon ***@***.***> wrote:
Can you elaborate on what you would expect a MultiSliver.builder to be?
—
Reply to this email directly, view it on GitHub
<#44 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAL75MGWC5DMGRCEVXOG2TU7OTF7ANCNFSM5QQRZT5Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@cgestes perhaps I can help come up with a solution for your specific problem, I still feel a builder version of MultiSliver is not possible with the current flutter implementation of Slivers |
I believe it is ok to leave it closed :) I have not enough context any more to provide any useful information. I dont even remember how I sorted out my issue in the end. Thank you @Kavantix . |
Not sure if I should comment here or create a new issue to continue the discussion. You might be right about Flutter's implementation of slivers and that it's not possible to create What are your thoughts? |
@cbarlow26 the problem you point out is exactly the difference that makes it not possible to do it the way SliverList does it. What SliverList basically does is only build a small subset of the children, but for slivers you always need to build all of them so there would be no time saved |
@Kavantix Thank you for the explanation. That's very interesting. In my case, and maybe others as well, I'm trying mix render boxes and render slivers inside a single Specifically, I'm using Any insights or solutions that you may have would be greatly appreciated. Thanks! |
How many of these pairs of sliver list and pinned header do you have? |
@Kavantix The list is fetched from a database and is infinite. Each call to the database retrieves a "page" worth of items which, in my case, is anywhere from 3 to 10 items. The The items are built as soon as they're retrieved from the database, so for me, I think it's ok if all the silvers are built. I think Anyway, thanks! |
I may have misspoke. |
You are correct about sliverlist building only what it needs, Listview is just a sliverlist but with a scrollview already configured around it. But if you are ok with building all the widgets, what is the builder version than useful for? |
The advantage of the I was hoping to simply replace my use of Thanks for helping me think through this. I'll post back if I come up with something clever. |
I would like to make a view like the schedule view of a calendar app.
A list view that is infinite in both direction, that can be indexed and that can have sticky header.
I am trying to adapt https://pub.dev/packages/indexed_list_view to support sliver children, I have thinking of returning MultiSliver instead of a SliverFixedExtentList, to be able to put SliverStickyHeader into the indexedlist.
Yeah not so simple !
So I would need a MultiSliver with a builder function.
If you have any feedback, this is very welcome :)
I looked everywhere and couldn't find anything.. maybe I am missing something obvious.
Thanks
The text was updated successfully, but these errors were encountered: