Restart.restartApp() uses a platform channel and must run on the main isolate.
Calling it from a background isolate throws:
Product
Background isolates
Route restart requests through the main isolate.
Route restart requests through the main isolate.
Restart.restartApp() uses a platform channel and must run on the main isolate.
Calling it from a background isolate throws: