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
Describe the bug
ref.watch(myProvider) is only disposing the provider when myProvider changed but not re-building it again
Initially when the app launches : i read this profileStatsInfoProvider by doing : ref.read(profileStatsInfoProvider) in my App widget inside the initState method. Though this is a FutureProvider it gets evaluated and I see logs which says reevaluating.
After a second, myProvider gets updated which causes the profileStatsInfoProvider also to get disposed right away. But what i'm expecting is that since its a FutureProvider and not an AutoDisposeFutureProvider , it should also get re-evaluated right away.
When i open a screen in the app which depends on this provider, then it reevaluates fresh.
To Reproduce
final profileStatsInfoProvider =FutureProvider<ProfileStatsResponseModel>((ref) async {
print('reevaluating');
ref.watch(myProvider);
return api.getProfileInfo(userId:'id');
});
Expected behavior :
when myProvider gets updated which causes the profileStatsInfoProvider also to get disposed, Expected behavior is that it profileStatsInfoProvider should get re-evaluated right away.
The text was updated successfully, but these errors were encountered:
The provider needs to be listened for the refresh to happen.
You only mentioned that you used ref.read to use that provider. As such, your provider is likely never listened, so will not refresh.
Describe the bug
ref.watch(myProvider) is only disposing the provider when myProvider changed but not re-building it again
Initially when the app launches : i read this profileStatsInfoProvider by doing :
ref.read(profileStatsInfoProvider)
in my App widget inside the initState method. Though this is a FutureProvider it gets evaluated and I see logs which saysreevaluating
.After a second, myProvider gets updated which causes the
profileStatsInfoProvider
also to get disposed right away. But what i'm expecting is that since its a FutureProvider and not an AutoDisposeFutureProvider , it should also get re-evaluated right away.When i open a screen in the app which depends on this provider, then it reevaluates fresh.
To Reproduce
Expected behavior :
when
myProvider
gets updated which causes theprofileStatsInfoProvider
also to get disposed, Expected behavior is that itprofileStatsInfoProvider
should get re-evaluated right away.The text was updated successfully, but these errors were encountered: