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
605 stars 201 forks source link

Toggle favourite status? #299

Closed mohadel92 closed 5 months ago

mohadel92 commented 7 months ago

i can't handle how to toggle changes on already loaded data in the pagecontroller is there is a recommended way to handle changes inside current data loaded inside controller?

caiombueno commented 7 months ago

Hi @mohadel92 .

If you want to manually manage the state of the PagingController, you can use the value setter from PagingController and assign a new PagingState to it.

_pagingController.value = PagingState(
      itemList: myItemList,
      nextPageKey: nextPageKey,
      error: null, // Or an error, if any.
    );

I hope this helps to solve your problem.

braincreator commented 7 months ago

_pagingController.value = PagingState( itemList: myItemList, nextPageKey: nextPageKey, error: null, // Or an error, if any. ); it's not working, updating itemList, does not refreshing view

caiombueno commented 6 months ago

hi @braincreator. Sorry for the late response. Try updating the state of the widget using setState or any other state management approach