Download files in parallel when attempting to share
This commit is contained in:
parent
ccf577c1bb
commit
585079b380
1 changed files with 3 additions and 2 deletions
|
@ -23,10 +23,11 @@ Future<void> shareMultiple(BuildContext context, List<File> files) async {
|
|||
}
|
||||
final dialog = createProgressDialog(context, "Preparing...");
|
||||
await dialog.show();
|
||||
final pathList = List<String>();
|
||||
final pathFutures = List<Future<String>>();
|
||||
for (File file in files) {
|
||||
pathList.add((await getNativeFile(file)).path);
|
||||
pathFutures.add(getNativeFile(file).then((file) => file.path));
|
||||
}
|
||||
final pathList = await Future.wait(pathFutures);
|
||||
await dialog.hide();
|
||||
return ShareExtend.shareMultiple(pathList, "image");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue