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
623 stars 210 forks source link

Refresh reloads the page, and scroll up to the first page, how can I update an item without reload the whole pages? #192

Closed rehamalraee24 closed 1 year ago

rehamalraee24 commented 2 years ago

I want to refresh one widget item within the items list, I have to call .refresh() function to update the data, How can I update one widget only or update the list without scrolling to the top and showing the progress indicator?

LeGoffMael commented 2 years ago

I think you could update the list of the controller directly:

that's how i deleted an element in the list

final list = _pagingController.itemList ?? [];
list.removeWhere((friend) => friend.id == user.id);
setState(() {
  _pagingController.itemList = list;
});