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

How can we use skeleton loading on this library. It doesnt seems like working. only lottie or normal loader works #249

Closed RahnDev closed 1 year ago

clragon commented 1 year ago

Your question does not include enough details for us to answer it.

Can you please elaborate? What is skeleton loading? "It doesnt seems like working" - please tell us exactly what is not working.

RahnDev commented 1 year ago

Hi @clragon , we looking to implement this library https://pub.dev/packages/skeletons as loader instead of CircularProgressBar. But after trying its unable to show up properly on first load and also on next page load

RahnDev commented 1 year ago

Hi @clragon sorry i found the issue. i missed out on this shrinkWrapFirstPageIndicators: true, after adding then it works. so i will close this. sorry for any inconvenience

mmercatdev commented 1 year ago

Hi all!

I was starting the integration of this in order to paginate a feed. Previously I had a FutureBuilder, with the future being the query to my backend. Then using the param initialData of the FutureBuilder I placed an skeleton while the query was running.

How was the final code used to show some skeleton loader combined with the pagination?

Can you please provide a working example? Thanks in advance!

RahnDev commented 1 year ago

Hi @mmercatdev

Here is example code for our project

PagedSliverList<int, CatalogueItems?>( shrinkWrapFirstPageIndicators: true, pagingController: pagings[i], builderDelegate: PagedChildBuilderDelegate<CatalogueItems?>( firstPageProgressIndicatorBuilder: (context) => _loader(count: 10), newPageProgressIndicatorBuilder: (context) => _loader(count: 1), firstPageErrorIndicatorBuilder: (context) => _emptyListingWidget(), noItemsFoundIndicatorBuilder: (context) => _emptyListingWidget(), animateTransitions: true, itemBuilder: (context, item, index) => _items(item) )),

shrinkWrapFIrstPageIndicators need to be set to true in order for Skeleton under _loader to work. Hope this helps you

mmercatdev commented 1 year ago

Thank you very much for that response! Much clear now!