You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setup PagingController and add PageRequestListener callback
final MyPagingController<int, MyItem> pagingController =
MyPagingController<int, MyItem>(firstPageKey: 1);
pagingController.addPageRequestListener((pageKey) {
print("NOTIFIED");
//put your request here
});
Add a delay before the request is triggered, simulating a scenario where the request doesn't execute immediately say 5 seconds.
After the initial page request is handled, scroll to the end of the list, triggering the next page request.
Modify the Item List while the second request is processing
final List<MyItem> newList = List.from(pagingController?.itemList ?? []);
// do your modification logic on newList for example, modify the isLiked variable in your list
newList[index] = newList[index].copyWith(isLiked: !newList[index].isLiked);
pagingController.itemList = newList;
While the next page request is still loading, make modifications to the itemList seems to cause the addPageRequestListener to be triggered again
Expected results
Modifying the itemList in the pagingController should not retrigger the addPageRequestListener if there is an active request or while the request is being processed.
Actual results
Modifying the itemList during an active request causes the addPageRequestListener to be triggered again unexpectedly.
Steps to reproduce
Add a delay before the request is triggered, simulating a scenario where the request doesn't execute immediately say 5 seconds.
After the initial page request is handled, scroll to the end of the list, triggering the next page request.
Modify the Item List while the second request is processing
Expected results
Modifying the itemList in the pagingController should not retrigger the addPageRequestListener if there is an active request or while the request is being processed.
Actual results
Modifying the itemList during an active request causes the addPageRequestListener to be triggered again unexpectedly.
Package Version
4.0.0
Platform
Android, iOS
Code sample
Code sample
Video
Screenshots / Video demonstration
Regular scenarioregular-scenario.mov
Issue
issue01.MOV
The text was updated successfully, but these errors were encountered: