v1.2.0
windows_single_instance
अपने Windows ऐप के एक ही प्रतिनिधि को बाध्य करता है, जब एक नया प्रतिनिधि खोला जाता है तो मौजूदा विंडो को सामने लाता है।
55लाइक 18.5 हज़ार30-दिन डाउनलोड150Pub अंक
Windows
SongbookPro/flutter_windows_single_instance open-source repository details.
{"sdk":"flutter"}>=6.0.0 <7.0.0>=1.0.0 <3.0.0{"sdk":"flutter"}^6.0.0यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
Restrict a Windows app to only be able to open one instance at a time.
WidgetsFlutterBinding.ensureInitialized(); to the start of your apps main function.async modifier to your apps main function.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.void main(List<String> args) async {
WidgetsFlutterBinding.ensureInitialized();
await WindowsSingleInstance.ensureSingleInstance(
args,
"custom_identifier",
onSecondWindow: (args) {
print(args);
});
runApp(const MyApp());
}