EdsonBueno / infinite_scroll_pagination

Flutter package to help you lazily load and display pages of items as the user scrolls down your screen.
https://pub.dev/packages/infinite_scroll_pagination
MIT License
612 stars 202 forks source link

Layout with mixed content type #259

Closed romatallinn closed 11 months ago

romatallinn commented 1 year ago

Hi,

I am trying to think through how I can create a layout that would be an infinite grid, but yet would allow me to periodically insert custom items in the view. You can imagine a feed of some content with periodic ads in it. But again, while the main content is a grid, the ad is just a full-width item.

I do understand low-level limitations to the task. I surely need to make a custom PagedSliverBuilder. But I am not sure how it should look inside? Should I go deeper and rewrite SliverGrid for this use case? Or there is something easier that can be done on PagedSliverBuilder level? Like some combination of slivers or widgets?

Thanks in advance!

clragon commented 1 year ago

the flutter_staggered_grid_view package which is partially integrated into this package on the dev branch might be helpful to your case. otherwise there is not much inbuilt to help you. you will need to create a builder that shifts indexes.

EdsonBueno commented 11 months ago

This is now in version 4.0.0. Please check PagedMasonrySliverGrid.