FLUTTER ECOSYSTEM

SongbookPro/flutter_windows_single_instance

SongbookPro/flutter_windows_single_instance open-source repository details.

flutter_windows_single_instance 프로젝트 이미지
Stars
16
Forks
13
최근 푸시(UTC)
2026. 6. 16.
프로젝트 상태
활성
SongbookPro GitHub avatar
GITHUB Organization

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

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

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());
}