chore: UX Feedback when selecting files needs some time
This commit is contained in:
parent
b841d8c09e
commit
0d438ee1ac
1 changed files with 10 additions and 6 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:fluffychat/widgets/future_loading_dialog.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
|
|
@ -14,14 +15,17 @@ Future<List<XFile>> selectFiles(
|
|||
}) async {
|
||||
if (!PlatformInfos.isLinux) {
|
||||
final result = await AppLock.of(context).pauseWhile(
|
||||
FilePicker.platform.pickFiles(
|
||||
compressionQuality: 0,
|
||||
allowMultiple: allowMultiple,
|
||||
type: type.filePickerType,
|
||||
allowedExtensions: type.extensions,
|
||||
showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () => FilePicker.platform.pickFiles(
|
||||
compressionQuality: 0,
|
||||
allowMultiple: allowMultiple,
|
||||
type: type.filePickerType,
|
||||
allowedExtensions: type.extensions,
|
||||
),
|
||||
),
|
||||
);
|
||||
return result?.xFiles ?? [];
|
||||
return result.result?.xFiles ?? [];
|
||||
}
|
||||
|
||||
if (allowMultiple) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue