terminate_restart
1.2.0, released 3 weeks ago by an unverified publisher
Flutter plugin for app termination, process restart, and optional data clearing.
What it does
Allows developers to restart their Flutter application either through a UI-only refresh or a full native process restart. It supports optional user confirmation dialogs and selective data management like clearing local storage or preserving keys.
AI-written summary of version 1.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to programmatically restart the app after an update or language change
- You require a full process restart or a quick UI-only refresh
- You want to prompt users with a confirmation dialog before terminating the app
Skip it when
- You only need standard deep linking or URL launching without restarting the entire app
- Your architecture heavily relies on maintaining persistent background isolates that cannot be cleanly reset
Strengths
- Offers both UI-only and full process restart modes
- Includes built-in user confirmation dialog options
- Supports Android, iOS, and Web platforms with granular data clearing and preservation settings
Weaknesses
- Requires iOS Info.plist URL scheme configurations for proper restarting
- Terminating processes on mobile platforms can be abrupt if not managed carefully
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Requires adding URL scheme entries to Info.plist on iOS for restart functionality to work properly, and wrapping the app with TerminateRestart.wrapWithRestart for UI-only resets.
void main() {
WidgetsFlutterBinding.ensureInitialized();
TerminateRestart.instance.initialize();
runApp(TerminateRestart.wrapWithRestart(child: MyApp()));
}
await TerminateRestart.instance.restartApp(
options: const TerminateRestartOptions(
terminate: true,
),
);Alternatives
Packages that do the same job and could replace terminate_restart.
- restart_app
Restart Flutter apps programmatically on Android, iOS, web, macOS, Linux, and Windows.
86Compare
Works with
Packages commonly used together with terminate_restart: ones it builds on, ones built on it, and its own family.