Restart.restartApp

Restarts the Flutter application and returns a structured result.
static Future<RestartResult> restartApp({
  RestartMode mode = RestartMode.platformDefault,
  String? webOrigin,
  String? notificationTitle,
  String? notificationBody,
  bool forceKill = false,
})
By default, this uses the best supported behavior for the current platform. Pass mode when you want a specific restart path, such as RestartMode.process, RestartMode.flutterEngine, or RestartMode.notificationFallback.

Restart.restartCapability

Returns the restart behavior available on the current platform.
static Future<RestartCapability> restartCapability()
Use this when your app should adapt UI or behavior to the current platform.

RestartMode

ValueDescription
platformDefaultUses the best behavior available for the current platform.
flutterEngineRecreates the Flutter engine in the same native process where supported.
processRequests a native process relaunch where the platform supports it.
notificationFallbackiOS-only legacy fallback that schedules a local notification, exits, and requires the user to tap the notification to reopen the app.

RestartResult

FieldDescription
successWhether the platform accepted and initiated the requested restart.
modeThe mode that was accepted by the platform.
codePlatform-specific error code when success is false.
messagePlatform-specific error message when success is false.

RestartCapability

FieldDescription
fullProcessRestartWhether this platform can relaunch the app in a fresh native process.
flutterEngineRestartWhether this platform can recreate Flutter in the current native process.
notificationFallbackWhether notification fallback is available on the current platform.
engineRestartConfiguredWhether Flutter engine restart has been configured by the host app.
platformDefaultModeThe behavior used by RestartMode.platformDefault.
reasonOptional explanation when a capability is unavailable or limited.