Comments (14)
Hi @hacker1024 .
I'm sorry for the delay. I'm on a trip right now and will be back in 10 days or so.
As soon as I'm back, I'll help you with that.
Thank you!
from infinite_scroll_pagination.
Thanks, I'll test it when I get the next opportunity (hopefully later today).
from infinite_scroll_pagination.
Hey @EdsonBueno , My issue was solved with bugfix/page-request-refactor
branch.
from infinite_scroll_pagination.
@awnigharbia and @hacker1024
I finally released this fix on version 2.2.3!
Thank you for your patience.
from infinite_scroll_pagination.
@hacker1024 Try replacing the code inside the if
with _pagingController.refresh()
. Tell me if it works, please!
If it doesn't work, I'll need a sample project.
from infinite_scroll_pagination.
Unfortunately, I can't use _pagingController.refresh()
here because the new request is made by my state management, which calls load()
again. As my code duplicates the refresh code without the duplicate request, however, I doubt using it will fix the issue. I'll make a sample project.
from infinite_scroll_pagination.
This issue was too tough to replicate, but I've diagnosed the cause.
It's not about the loading state like I originally thought, but instead about _lastFetchTriggerIndex
.
When I refresh my list, I download the first page again manually, and then provide it to the PagingController
.
As the widget never requests the first page itself, the status goes straight from completed to ongoing, and this code never runs. _lastFetchTriggerIndex
is never reset.
As a result, when the second page was the last page that was loaded before refreshing, it will not be requested again after refreshing.
This only applies to the second page specifically, because if a later page was the last page loaded, the scond page would load before it and overwrite _lastFetchTriggerIndex
.
Do you have any ideas of how to fix this?
from infinite_scroll_pagination.
@hacker1024 Can you test it with the code on the bugfix/page-request-trigger-index
branch?
If it works I'll release it.
from infinite_scroll_pagination.
Unfortunately, it's causing some problems. I'll debug and get back to you.
from infinite_scroll_pagination.
Okay, here's what's happening now:
- User opens screen, first page loads.
- Data is modified on the server.
- User scrolls down,
_pageRequestTriggerIndex
is set to the next page's value, the next page tries to load and fails. Error text is given to the paging controller instead. - User refreshes the page, which results in the first page being downloaded and provided to the controller.
- User scrolls down. The
newTriggerIndex
is the second page's value, which is compared to_pageRequestTriggerIndex
- but this has not changed since refreshing, and has remained set to the second page's value._hasRequestedPageForTriggerIndex
remainstrue
, and the second page is not requested when it should be.
from infinite_scroll_pagination.
Hi @hacker1024 . I'm back!
Please, can you test it again with the code on bugfix/page-request-refactor
?
I also changed that code from your merged PR. So, it would be great if you could also test this.
Thank you! I'm waiting your feedback.
from infinite_scroll_pagination.
@hacker1024 any news on this?
from infinite_scroll_pagination.
Hi @EdsonBueno, I have a problem when use _pagingController.refresh()
this function should work to clear the data and then reload the data it gets, it's right?.
If so, what happened to my project was not the case, but instead the data increased and did not empty the previous data.
I used this example on my project.
from infinite_scroll_pagination.
@verkit Can you share a toy project reproducing the issue? Since the example doesn't have the same bug, it's probably something on your end.
As this is not related to this issue, please send me via chat.
Thank you so much!
from infinite_scroll_pagination.
Related Issues (20)
- GetX Controller not working
- How to handle item deletion? HOT 1
- _pagingController dispose issue when used inside a BLoC HOT 2
- [Feature Request]: Auto scroll/slide PagedPageView children HOT 1
- Infinite Staggered View HOT 2
- How can i do offline search/filter? HOT 2
- Using this package with nestedscrollview/tab bars causes issue with scrolling HOT 3
- Expose ScrollBehavior
- Plans for new release HOT 2
- Example beer API seems to be not available anymore HOT 2
- Is it possible to insert a new item with animation? HOT 1
- how to remove an item HOT 1
- How to retain scroll position after forcing a controll refresh? HOT 1
- Prepend functionality HOT 2
- Flutter 3.22 support HOT 1
- PagedMasonryGridView can't scroll by mouse in desktop web HOT 1
- Fatal Exception: Null check operator used on a null value HOT 3
- How to implement newPageErrorIndicatorBuilder? HOT 1
- New page error "try again" may fail due to invisibleItemsThreshold
- Does it support multiple SliverList? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from infinite_scroll_pagination.