Install

Requires Flutter 3.22 or later and Dart 3.4 or later.

Usage

Import the package and call Restart.restartApp() from a button or another app action:
iOS: follow the AppDelegate setup before calling this method. It registers your plugins with the replacement Flutter engine. The default call chooses the restart behavior for the platform. On web, it reloads the whole Flutter app at the same browser URL. See platform behavior for all six platforms.

Error handling

To handle a rejected restart request, read the returned RestartResult:
A successful result means the platform accepted the request. Restarting can stop the calling Dart code, so complete any work that must finish before the call. If your app has unsaved edits, save them through your usual storage code first. A restart does not erase preferences, files, or databases.

Options

For a different behavior, such as an Android process restart or a web restart at a particular route, see configuration. The API reference lists every parameter, result field, and capability.

Requirements

Your Flutter SDK and other dependencies may require newer OS versions. For example, Flutter 3.47 requires Android 24, iOS 15, and macOS 12. Older deployment targets need a Flutter SDK that still supports them. See Flutter’s supported platforms. The Android plugin supports AGP 8 and 9, including projects with android.builtInKotlin=false. Enabling AGP’s built-in Kotlin requires Flutter 3.47 or later. Keep your existing setting unless you are migrating to built-in Kotlin.