Seamlessly restart your Flutter desktop applications with a single line of code.
- 🔄 Instant app restart
- ⏱️ Scheduled restarts
- 🖥️ Desktop platform support (macOS, Windows*, Linux*)
*Note: Windows and Linux support is experimental and needs further testing.
Add flutter_restart_app
to your pubspec.yaml
:
dependencies:
flutter_restart_app: ^0.1.0
Then run:
flutter pub get
import 'package:flutter_restart_app/flutter_restart_app.dart';
await FlutterRestartApp.instance.now();
FlutterRestartApp.instance.scheduleRestart(Duration(seconds: 5));
import 'package:flutter/material.dart';
import 'package:flutter_restart_app/flutter_restart_app.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Flutter Restart App Demo')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () => FlutterRestartApp.instance.now(),
child: Text('Restart Now'),
),
ElevatedButton(
onPressed: () => FlutterRestartApp.instance.scheduleRestart(Duration(seconds: 5)),
child: Text('Restart in 5 seconds'),
),
],
),
),
),
);
}
}
Platform | Support |
---|---|
macOS | ✅ Stable |
Windows | 🧪 Experimental |
Linux | 🧪 Experimental |
We welcome contributions to improve Flutter Restart App, especially for Windows and Linux support. If you encounter any issues or have suggestions, please open an issue on our GitHub repository.
To contribute:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Please note that all contributions are subject to review and approval by the Klarity team.
This project is proprietary software owned by Klarity. All rights reserved. See the LICENSE file for details.
For any inquiries or support, please contact us at [email protected]
Made with ❤️ by Klarity