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
The AutoDisposeNotifierProvider leads to a state loss when performing an operation that triggers a state change in the notifier and attempts to retrieve the state afterward.
The initial state of providerAProvider is State.initial, and the expected behavior is for the await ref.read(providerAProvider.notifier).change(); operation to transition the state to State.success rather than staying at State.initial. For instance:
await ref.read(providerAProvider.notifier).change();
if (kDebugMode) {
print(ref.read(providerAProvider)); // Expect State.success
}
Describe the bug
The AutoDisposeNotifierProvider leads to a state loss when performing an operation that triggers a state change in the notifier and attempts to retrieve the state afterward.
The initial state of
providerAProvider
isState.initial
, and the expected behavior is for theawait ref.read(providerAProvider.notifier).change();
operation to transition the state toState.success
rather than staying atState.initial
. For instance:To Reproduce
Run the code in the link below:
https://github.com/LeonardoRosaa/riverpod-state-loss
Expected behavior
It's expected that the Riverpod keeps the state while the widget is alive.
The text was updated successfully, but these errors were encountered: