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 have an issue about the android app sleep/detached. After 15min, OS detaching flutter app, then I'm got lost my notifier variables.
I have and UserNotifierState, it shares user informations to PostNotifierState, after sleep there is no UserNotifierState anymore, is there any solution for this? You can easily reproduce this with debug settings called "don't keep activities", activate this settings, then open app, go to home, then go back to your app, your notifier variables will be gone. How can I get recreate this wasted notifiers when I lost these notifiers?
class AuthModel with ChangeNotifier {
...
}
final authNotifierProvider = ChangeNotifierProvider<AuthModel>(
(ref) => AuthModel(),
);
// I'm using change notifier for go_router to easily manage user states
class SocialPostState {
...
final List<Post?> allPosts;
...
}
class SocialPostNotifier extends Notifier<SocialPostState> {
....
Future<void> getAllPosts() async {
....
userId = ref.watch(authNotifierProvider).userId;
// fetch users posts
}
}
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
-
I have an issue about the android app sleep/detached. After 15min, OS detaching flutter app, then I'm got lost my notifier variables.
I have and UserNotifierState, it shares user informations to PostNotifierState, after sleep there is no UserNotifierState anymore, is there any solution for this? You can easily reproduce this with debug settings called "don't keep activities", activate this settings, then open app, go to home, then go back to your app, your notifier variables will be gone. How can I get recreate this wasted notifiers when I lost these notifiers?
Beta Was this translation helpful? Give feedback.
All reactions