windows_single_launch 0.0.4
windows_single_launch: ^0.0.4 copied to clipboard
Launch Windows applications from a single instance. Brings the current instance to the front on each launch.
Windows Single Launch #
Launch Windows applications from a single instance. Brings the current instance to the front on each launch.
If you do not want a new instance to run every time you run your application, you can use this plugin. With its simple use, it forces your application to run in a single instance in a good way. If the application is already open, when you run it again, it brings the current application to the front, and if it is hidden, it makes it visible.
Usage #
- Add
WidgetsFlutterBinding.ensureInitialized();
to the start of your appsmain
function. - Use
WindowsSingleLaunch.singleRunApp()
instead ofrunApp()
to run your application. - singleRunApp(
app:
(Your application),
originalName:
(OriginalName of your application written in windows/runner/Runner.rc),
windowTitleName:
(title of your application written in windows/runner/main.cpp)
):
Example #
void main() {
WidgetsFlutterBinding.ensureInitialized();
WindowsSingleLaunch().singleRunApp(
app: const MyApp(),
originalName: "windows_single_launch_example.exe",
windowTitleName: "Windows Single Launch",
);
}