ftognetto / riverpod_infinite_scroll

A plugin for Flutter's infinite_scroll_pagination that works with Riverpod.
MIT License
27 stars 23 forks source link

state is erased in pullToRefresh with PagedNotifierMixin #17

Closed h-unterp closed 2 years ago

h-unterp commented 2 years ago

enable pull to refresh on custom example, then set a breakpoint: https://github.com/ftognetto/riverpod_infinite_scroll/blob/5d596555f653f201da086a7d775a3607e6df239b/example/lib/custom/custom_example_provider.dart#L63

You will see that all of the members of the state object are null.

Screen Shot 2022-07-16 at 1 37 16 PM

You may need to pull to refresh a few times.

However in my app, the state is "erased" after the first pullToRefresh

h-unterp commented 2 years ago

Maybe this is not a bug? Riverpod will dispose the provider when it is refreshed. The only issue is how to handle this properly. The example seems to work ok.

ftognetto commented 2 years ago

Hi @h-unterp sorry for the late reply I unfortunately broken my arms, and now I'm slowly coming back :)

What's the problem here? When you pull to refresh riverpod will refresh entirely your provider so it's normal that your state is empty at that point