feat: Display progress for downloading content
This commit is contained in:
parent
57a5e1c96f
commit
969f1deb48
3 changed files with 46 additions and 4 deletions
|
|
@ -14,7 +14,15 @@ extension LocalizedBody on Event {
|
|||
Future<async.Result<MatrixFile?>> _getFile(BuildContext context) =>
|
||||
showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: downloadAndDecryptAttachment,
|
||||
futureWithProgress: (onProgress) {
|
||||
final fileSize =
|
||||
infoMap['size'] is int ? infoMap['size'] as int : null;
|
||||
return downloadAndDecryptAttachment(
|
||||
onDownloadProgress: fileSize == null
|
||||
? null
|
||||
: (bytes) => onProgress(bytes / fileSize),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
void saveFile(BuildContext context) async {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue