feat: Display progress for downloading content

This commit is contained in:
Christian Kußowski 2025-10-01 07:59:20 +02:00
commit 969f1deb48
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
3 changed files with 46 additions and 4 deletions

View file

@ -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 {