Closed emiguzik closed 3 years ago
Hi @emiguzik.
This doesn't happen on mobile apps, and your code looks correct, so it might be something with web.
One thing I noticed (which shouldn't be the problem), is that you're using shrinkWrap: true
. My guess is you're using it because this widget is being used inside another scrollable widget.
When that is the case (scrollable widgets inside scrollable widgets, both in the same direction) you should work with Flutter Slivers. This package has a Sliver version of a paginated list, which is PagedSliverList
.
Please, try seeing if that is the problem, and if it isn't, can you provide me a toy project reproducing the issue so that I can help you with it?
Got it to work for me, this is what (the possibly relevant parts of) my widget tree looks like now in case it helps @emiguzik (arrow represents child)
Scaffold -> SafeArea -> Column -> Expanded ->CustomScrollView -> slivers: [SliverList, Builder -> BlocListener -> PagedSliverList]
Thank you so much @Martibis. The nested scrolling views kill the lazy effect. I'm closing this issue for now, but feel free to reopen it @emiguzik.
Hi, I'm working on pagination for my app (Flutter for web) and I noticed two issues:
_fetchPage
is called two times for eachpageKey
)What is interesting, the number of items as a result is correct, no duplications. So for end user it's not really visible, and still better than waiting for one huge request, but would be nice to get this working properly. Might it be different behavior for
PagingController
in web?Code: