I am trying to fix image picker
This commit is contained in:
parent
bffde24279
commit
d2c9c179aa
|
|
@ -13,37 +13,18 @@ Future<List<XFile>> selectFiles(
|
|||
FileSelectorType type = FileSelectorType.any,
|
||||
bool allowMultiple = false,
|
||||
}) async {
|
||||
if (!PlatformInfos.isLinux) {
|
||||
final result = await AppLock.of(context).pauseWhile(
|
||||
showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () => FilePicker.platform.pickFiles(
|
||||
compressionQuality: 0,
|
||||
allowMultiple: allowMultiple,
|
||||
type: type.filePickerType,
|
||||
allowedExtensions: type.extensions,
|
||||
),
|
||||
final result = await AppLock.of(context).pauseWhile(
|
||||
showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () => FilePicker.platform.pickFiles(
|
||||
compressionQuality: 0,
|
||||
allowMultiple: allowMultiple,
|
||||
type: type.filePickerType,
|
||||
allowedExtensions: type.extensions,
|
||||
),
|
||||
);
|
||||
return result.result?.xFiles ?? [];
|
||||
}
|
||||
|
||||
if (allowMultiple) {
|
||||
return await AppLock.of(context).pauseWhile(
|
||||
openFiles(
|
||||
confirmButtonText: title,
|
||||
acceptedTypeGroups: type.groups,
|
||||
),
|
||||
);
|
||||
}
|
||||
final file = await AppLock.of(context).pauseWhile(
|
||||
openFile(
|
||||
confirmButtonText: title,
|
||||
acceptedTypeGroups: type.groups,
|
||||
),
|
||||
);
|
||||
if (file == null) return [];
|
||||
return [file];
|
||||
return result.result?.xFiles ?? [];
|
||||
}
|
||||
|
||||
enum FileSelectorType {
|
||||
|
|
|
|||
2377
pubspec.lock
2377
pubspec.lock
File diff suppressed because it is too large
Load Diff
|
|
@ -97,7 +97,7 @@ dependencies:
|
|||
url_launcher: ^6.2.5
|
||||
video_compress: ^3.1.4
|
||||
video_player: ^2.9.2
|
||||
vodozemac: ^0.2.0
|
||||
vodozemac: ^0.3.0
|
||||
wakelock_plus: ^1.2.2
|
||||
webrtc_interface: ^1.0.13
|
||||
dio: ^5.9.0
|
||||
|
|
|
|||
Loading…
Reference in New Issue