Replies: 1 comment
-
Use ref.listenManual(provider, ...) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have defined a StateProvider to listen for changes in the user token (user login or logout), and when the token changes, I need to create different gRPC services. How should I listen for this change?
`final userDataProvider =
StateNotifierProvider<UserNotifier, UserEntity?>((ref) {
return UserNotifier(app.userEntity);
});
final signUpProvider = StateProvider.autoDispose<String?>((ref) {
final ret = ref.watch(userDataProvider);
ref.onDispose(() {
logger?.i("signUpProvider has ben dispose");
});
return ret?.token;
});
`
Beta Was this translation helpful? Give feedback.
All reactions