TF-2177 Add loading bar progress when download attachment
Signed-off-by: dab246 <tdvu@linagora.com> (cherry picked from commit a02cb14233c4b23e26a0d2881604024893f6e1ce)
This commit is contained in:
@@ -366,7 +366,11 @@ class EmailAPI with HandleSetErrorMixin {
|
||||
headers: headerParam,
|
||||
responseType: ResponseType.bytes),
|
||||
onReceiveProgress: (downloaded, total) {
|
||||
final progress = (downloaded / total) * 100;
|
||||
log('DownloadClient::downloadFileForWeb(): downloaded = $downloaded | total: $total');
|
||||
double progress = 0;
|
||||
if (downloaded > 0 && total > downloaded) {
|
||||
progress = (downloaded / total) * 100;
|
||||
}
|
||||
log('DownloadClient::downloadFileForWeb(): progress = ${progress.round()}%');
|
||||
onReceiveController.add(Right(DownloadingAttachmentForWeb(
|
||||
taskId,
|
||||
|
||||
Reference in New Issue
Block a user