Skip to content

klarity-app/flutter_restart_app

Repository files navigation

Flutter Restart App

pub package License: Proprietary

Seamlessly restart your Flutter desktop applications with a single line of code.

Flutter Restart App Demo

🚀 Features

  • 🔄 Instant app restart
  • ⏱️ Scheduled restarts
  • 🖥️ Desktop platform support (macOS, Windows*, Linux*)

*Note: Windows and Linux support is experimental and needs further testing.

🛠️ Installation

Add flutter_restart_app to your pubspec.yaml:

dependencies:
  flutter_restart_app: ^0.1.0

Then run:

flutter pub get

🔧 Usage

Import the package

import 'package:flutter_restart_app/flutter_restart_app.dart';

Restart immediately

await FlutterRestartApp.instance.now();

Schedule a restart

FlutterRestartApp.instance.scheduleRestart(Duration(seconds: 5));

📱 Example

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

Platform Support
macOS ✅ Stable
Windows 🧪 Experimental
Linux 🧪 Experimental

🤝 Contributing

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:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Please note that all contributions are subject to review and approval by the Klarity team.

📄 License

This project is proprietary software owned by Klarity. All rights reserved. See the LICENSE file for details.

📬 Contact

For any inquiries or support, please contact us at [email protected]


Made with ❤️ by Klarity