Reputation: 13
Is there a way I can initiate a complete restart of my flutter application from within the code itself?
I mean a restart at the OS level (making an iOS app)
Upvotes: 1
Views: 4826
Reputation: 44141
Depending on what you mean by "restart", you might be able to set an exception handler in your main
, and at the level you want to "restart", throw that exception, catch it in main, and re-run your RunApp
.
Upvotes: 1
Reputation: 268174
You can't restart the app at OS level as far as iOS is concerned due to Apple ecosystem.
However, you can do that in Android, you'll have to use MethodChannel
approach, here is the solution
Upvotes: 2