mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-04 08:10:55 +00:00
fix(macos): initialize file picker for non-sandboxed windows
This commit is contained in:
1 parent
f0aa44455c
commit
a45b6455be
1 file changed
+6
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:app_links/app_links.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -17,6 +18,11 @@ import 'util/util.dart';
|
||||
|
||||
Future<void> main(List<String> args) async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
if (Util.isMacos()) {
|
||||
// Gopeed is not sandboxed. Configure each engine before the main/child
|
||||
// window split so native file and directory dialogs work in both windows.
|
||||
await FilePicker.skipEntitlementsChecks();
|
||||
}
|
||||
if (Util.isAndroid()) {
|
||||
FlutterForegroundTask.initCommunicationPort();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user