Skip to content

Avoid dispose singleton #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
antonino-tocco opened this issue Dec 3, 2019 · 5 comments
Closed

Avoid dispose singleton #34

antonino-tocco opened this issue Dec 3, 2019 · 5 comments

Comments

@antonino-tocco
Copy link

Hi, I need help with an issue.
I observed that when the app go to background the Singleton are disposed.
It is possibile to avoid dispose singleton on app background?

Thanks in advance

@escamoteur
Copy link
Collaborator

I guess you talk about sending the app in to the background by using the backbutton on Android?
I just spoke to one of the flutter team and he said there is no guarantee that the activity is not destroyed in that case, so you have to expect that no data is preserved.
So you have to save any state that you need later.

@antonino-tocco
Copy link
Author

No, I'm talking about sending app in the background with home button in android not back button.
With the back button the activity is destroyed

@escamoteur
Copy link
Collaborator

hmm, I test again

@escamoteur
Copy link
Collaborator

just tried it with the sample app of GetIt and it does not get disposed, but I know that Android can kill theactivity there too if memory gets low

@escamoteur
Copy link
Collaborator

Try it yourself, I just pushed the latest version to github.

In general you app has to expect that it get's killed by Android

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants