Closed FarhanSajid1 closed 1 year ago
you should not be caching widgets, your data should be held in the controller and widgets should be built from it. the widgets will be disposed and built as they come and go into the viewport. this is expected as having infinite widgets built will quickly degrade the performance of your app as the user scrolls down. it is fundamentally incomaptible with infinite pagination. the widgets inside of the builder delegate should optimally also not make API requests. if they still have to, you can cache those requests instead, for example in a http client like dio with an interceptor.
Hey there, I'm new to flutter and this package seems highly extensible and can fit a large number of use cases. I was wondering if an example could be added for caching widgets with this package, it seems like when I scroll up/down widgets are reloaded which results in additional api calls to be sent which is not expected. I've gone through the example article here: https://www.raywenderlich.com/14214369-infinite-scrolling-pagination-in-flutter and the cookbook, but have not seen how to do this with this package.
I've also tried creating a map and check if the index exists before the builder runs, but that also does not seem to work
Could someone point me to a snippet of code, I can add it to the repo after. Thank you in advance.