smart_restart 0.1.0
smart_restart: ^0.1.0 copied to clipboard
Simple, no-setup app restart for Flutter. Clean relaunch on Android.
smart_restart #
Clean, no-setup app restart for Flutter (Android).
⚡️ Features #
- Android: Relaunches your app by clearing the task and starting a new launch intent, then finishing the current task. This is particularly useful after a hotfix or patch has been downloaded.
- iOS: Not implemented yet. This is currently a no-op on iOS.
📦 Install #
Add the following to your pubspec.yaml file:
dependencies:
smart_restart: ^0.1.0
🚀 Usage #
Just call SmartRestart.restart() whenever you need to restart your app.
import 'package:smart_restart/smart_restart.dart';
// ...
ElevatedButton(
onPressed: () async => SmartRestart.restart(),
child: const Text('Restart App'),
);