egbenedict
egbenedict

Reputation: 13

Completely Restart App From Within the Code

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

Answers (2)

Randal Schwartz
Randal Schwartz

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

CopsOnRoad
CopsOnRoad

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

Related Questions