搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫SongbookPro/flutter_windows_single_instance

flutter_windows_single_instance

SongbookPro/flutter_windows_single_instance open-source repository details.

flutter_windows_single_instance 專案封面
星標
16
分支
13
最近推送(UTC)
2026年6月16日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

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 作者

SongbookPro ↗

語言C++CMakeDartC

此儲存庫發佈的套件

使用的依賴

依賴清單 5 項

  • flutter{"sdk":"flutter"}
  • win32>=6.0.0 <7.0.0
  • ffi>=1.0.0 <3.0.0
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^6.0.0

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

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

GitHub Docs — About repositories ↗