Search packages, repositories and app categories

GitHub repositorySongbookPro/flutter_windows_single_instance

flutter_windows_single_instance

SongbookPro/flutter_windows_single_instance open-source repository details.

flutter_windows_single_instance project cover
Stars
16
Forks
13
Last push (UTC)
Jun 16, 2026
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

Windows Single Instance

Restrict a Windows app to only be able to open one instance at a time.

Installing

  1. Add WidgetsFlutterBinding.ensureInitialized(); to the start of your apps main function.
  2. Add the async modifier to your apps main function.
  3. Add a call to WindowsSingleInstance.ensureSingleInstance(), passing the apps startup args, a custom app string unique to your app (a-z, 0-9, _ and - only), and an optional callback function.

Example

void main(List<String> args) async {
    WidgetsFlutterBinding.ensureInitialized();
    await WindowsSingleInstance.ensureSingleInstance(
        args,
        "custom_identifier",
        onSecondWindow: (args) {
            print(args);
        });
    runApp(const MyApp());
}
SongbookPro GitHub avatar
GitHub author

SongbookPro ↗

LanguagesC++CMakeDartC

Packages published by this repository

Dependencies used

Dependency list 5 items

  • flutter{"sdk":"flutter"}
  • win32>=6.0.0 <7.0.0
  • ffi>=1.0.0 <3.0.0
  • flutter_testDevelopment{"sdk":"flutter"}
  • flutter_lintsDevelopment^6.0.0

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗