Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lsegal/flutter_multi_instance_handler
Detect and handle multiple instances of a Flutter application.
https://github.com/lsegal/flutter_multi_instance_handler
Last synced: about 2 months ago
JSON representation
Detect and handle multiple instances of a Flutter application.
- Host: GitHub
- URL: https://github.com/lsegal/flutter_multi_instance_handler
- Owner: lsegal
- License: mit
- Created: 2021-04-27T06:06:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-13T00:35:27.000Z (almost 3 years ago)
- Last Synced: 2024-10-31T06:51:32.155Z (2 months ago)
- Language: C++
- Size: 37.1 KB
- Stars: 3
- Watchers: 4
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Multi Instance Handler (`multi_instance_handler`)
Detects and handles multiple instances of an application. This library allows
you to forward command line arguments from second instances of an application,
force a single instance of an application, or both.## Compatibility
This library is designed for use in Flutter applications. Support in Dart
tools is undefined.This library currently only supports Flutter applications on the Windows
platform.## Usage
```dart
import 'package:multi_instance_handler/multi_instance_handler.dart';void main(List arguments) async {
if (await isFirstInstance(arguments)) {
onSecondInstance((List args) {
print("Second instance launched with: $args");
});
runApp(MyApp());
} else {
print("Found existing instance, quitting!");
exit(0);
}
}
```## TODO
- [ ] Add macOS support
- [ ] Add Linux support
- [ ] Ensure first instance window is hidden when loading (third-party issue).## License & Author
This library was written by Loren Segal in 2021 and licensed under the terms of
the MIT license.