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
...
I/flutter (14969): called future3
I/flutter (14969): called future1
I/flutter (14969): called combined2
I/flutter (14969): called combined1
I/flutter (14969): called future2
I/flutter (14969): called future1
I/flutter (14969): called future3
...
Expected
When updating, each source should be built only once (preventing the same API call from being made twice), and the combined FutureProvider should also be updated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Overview
There are four
FutureProviders
orAsyncNotifierProviders
that serve as sources (typically caching the results of API calls).When there is a
FutureProvider
that combines sources, please tell me the correct way to update this combinedFutureProvider
.What I Tried
I simply attempted to
invalidate
orinvalidateSelf
the sources, but it seems that each source is built twice.Expected
When updating, each source should be built only once (preventing the same API call from being made twice), and the combined
FutureProvider
should also be updated.Full source code is here: https://github.com/saccho/refresh_combined_demo
Beta Was this translation helpful? Give feedback.
All reactions