|
1 | 1 | import 'dart:io'; |
2 | 2 |
|
3 | | -import 'package:filesystem_picker/filesystem_picker.dart'; |
| 3 | +import 'package:file_picker/file_picker.dart'; |
4 | 4 | import 'package:flutter/material.dart'; |
5 | 5 | import 'package:pikapika/basic/Channels.dart'; |
6 | 6 | import 'package:pikapika/basic/Common.dart'; |
@@ -43,7 +43,7 @@ class _DownloadImportScreenState extends State<DownloadImportScreen> { |
43 | 43 | } |
44 | 44 |
|
45 | 45 | @override |
46 | | - Widget build(BuildContext context){ |
| 46 | + Widget build(BuildContext context) { |
47 | 47 | return rightClickPop( |
48 | 48 | child: buildScreen(context), |
49 | 49 | context: context, |
@@ -96,15 +96,15 @@ class _DownloadImportScreenState extends State<DownloadImportScreen> { |
96 | 96 | defaultToast(context, "$e"); |
97 | 97 | return; |
98 | 98 | } |
99 | | - String? path = await FilesystemPicker.open( |
100 | | - title: '选择要导入的文件', |
101 | | - context: context, |
102 | | - rootDirectory: Directory(chooseRoot), |
103 | | - fsType: FilesystemType.file, |
104 | | - folderIconColor: Colors.teal, |
105 | | - allowedExtensions: ['.zip'], |
106 | | - fileTileSelectMode: FileTileSelectMode.wholeTile, |
| 99 | + var ls = await FilePicker.platform.pickFiles( |
| 100 | + dialogTitle: '选择要导入的文件', |
| 101 | + allowMultiple: false, |
| 102 | + initialDirectory: chooseRoot, |
| 103 | + type: FileType.custom, |
| 104 | + allowedExtensions: ['zip'], |
| 105 | + allowCompression: false, |
107 | 106 | ); |
| 107 | + String? path = ls != null && ls.count > 0 ? ls.paths[0] : null; |
108 | 108 | if (path != null) { |
109 | 109 | try { |
110 | 110 | setState(() { |
|
0 commit comments