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:
+10
-1
@@ -34,7 +34,16 @@ class DownloadTaskState with EquatableMixin {
|
||||
);
|
||||
}
|
||||
|
||||
double get percentDownloading => progress / 100;
|
||||
double get percentDownloading {
|
||||
final percent = progress / 100;
|
||||
if (percent < 0) {
|
||||
return 0;
|
||||
} else if (percent > 1) {
|
||||
return 1;
|
||||
} else {
|
||||
return percent;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [taskId, attachment, progress, downloaded, total];
|
||||
|
||||
Reference in New Issue
Block a user