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:flutter/widgets.dart';
|
||||||
|
|
||||||
import 'package:file_picker/file_picker.dart';
|
import 'package:file_picker/file_picker.dart';
|
||||||
|
|
@ -14,14 +15,17 @@ Future<List<XFile>> selectFiles(
|
||||||
}) async {
|
}) async {
|
||||||
if (!PlatformInfos.isLinux) {
|
if (!PlatformInfos.isLinux) {
|
||||||
final result = await AppLock.of(context).pauseWhile(
|
final result = await AppLock.of(context).pauseWhile(
|
||||||
FilePicker.platform.pickFiles(
|
showFutureLoadingDialog(
|
||||||
compressionQuality: 0,
|
context: context,
|
||||||
allowMultiple: allowMultiple,
|
future: () => FilePicker.platform.pickFiles(
|
||||||
type: type.filePickerType,
|
compressionQuality: 0,
|
||||||
allowedExtensions: type.extensions,
|
allowMultiple: allowMultiple,
|
||||||
|
type: type.filePickerType,
|
||||||
|
allowedExtensions: type.extensions,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return result?.xFiles ?? [];
|
return result.result?.xFiles ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allowMultiple) {
|
if (allowMultiple) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue