add restartApp() method
### Is there an existing issue for this? - [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues) - [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports) ### Use case There is no canonical way to restart a flutter app in production. This is useful as part of a state clearing routine. There are multiple methods, but they all have drawbacks, and none of them are canonical Why: - Useful for integration testing - Customer care troubleshooting - Allow user to get fresh state without uninstalling app - Auto reset app state if there is a crash loop on launch Proposal: - add a `restartApp()` method to go with `runApp()` Functionality: - relaunches the flutter instance with fresh state - does not reset stored state (shared_preferences, sqlite, etc) - does not quit the native app Community suggestions: - use runApp() again -> no-op in testing - send SIGUSR2 -> doesn't work in prod - swap a GlobalKey on top level widget -> doesn't work for all DI systems - `flutter_phoenix` -> GlobalKey method Ethos argument: This is a primitive action that should be dependable, reliable, and opinionated Community feedback in support: - https://twitter.com/peteralexbizjak/status/1660962150288965632 - https://twitter.com/wamweaaa/status/1660894603321516034 - https://twitter.com/mwhmyers/status/1661040773461319681 - https://twitter.com/yasinilhan/status/1661079434881802241
Posted by lukepighetti on May 23, 2023, 5:15 PM
Tags
Related issues
- Many devs love to shit on the guy from the 'I just want the exe.
- Now imagine how poor people stress if their smartphone bricks or gets damaged or lost.
- Resuming an extended-thinking session fails permanently with 400 "thinking blocks cannot be modified" (transcript stores thinking text as empty but keeps signat
- I'll preface this with a statement that as a European I want European alternatives to succeed, and MS-owned GitHub to shrivel and disappear.
- Yeah, but there’s a world of difference between “not perfect” and “we rounded a few sliders, and now the modal is a nightmare to use”.
- I used to write a lot of native Windows corporate software in the 90's and 2000's and my standard login window was a floating draggable o...
Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments
reliability (SaaS)
Many devs love to shit on the guy from the 'I just want the exe.
Now imagine how poor people stress if their smartphone bricks or gets damaged or lost.
Resuming an extended-thinking session fails permanently with 400 "thinking blocks cannot be modified" (transcript stores thinking text as empty but keeps signat
I'll preface this with a statement that as a European I want European alternatives to succeed, and MS-owned GitHub to shrivel and disappear.
Yeah, but there’s a world of difference between “not perfect” and “we rounded a few sliders, and now the modal is a nightmare to use”.
I used to write a lot of native Windows corporate software in the 90's and 2000's and my standard login window was a floating draggable o...
App broken with Mosquitto broker 7.0.0
[BUG] Remote Control: automatic reconnection doesn't work -- connection drops silently with no recovery
add restartApp() method
### Is there an existing issue for this? - [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues) - [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports) ### Use case There is no canonical way to restart a flutter app in production. This is useful as part of a state clearing routine. There are multiple methods, but they all have drawbacks, and none of them are canonical Why: - Useful for integration testing - Customer care troubleshooting - Allow user to get fresh state without uninstalling app - Auto reset app state if there is a crash loop on launch Proposal: - add a `restartApp()` method to go with `runApp()` Functionality: - relaunches the flutter instance with fresh state - does not reset stored state (shared_preferences, sqlite, etc) - does not quit the native app Community suggestions: - use runApp() again -> no-op in testing - send SIGUSR2 -> doesn't work in prod - swap a GlobalKey on top level widget -> doesn't work for all DI systems - `flutter_phoenix` -> GlobalKey method Ethos argument: This is a primitive action that should be dependable, reliable, and opinionated Community feedback in support: - https://twitter.com/peteralexbizjak/status/1660962150288965632 - https://twitter.com/wamweaaa/status/1660894603321516034 - https://twitter.com/mwhmyers/status/1661040773461319681 - https://twitter.com/yasinilhan/status/1661079434881802241
Comments (0)
No comments yet. Start the discussion.