TF-3454 Download all attachments as ZIP

This commit is contained in:
DatDang
2025-02-07 14:38:53 +07:00
committed by Dat H. Pham
parent 636df94458
commit f66e1460e4
34 changed files with 1175 additions and 100 deletions
@@ -76,8 +76,8 @@ class DownloadTaskItemWidget extends StatelessWidget {
DefaultTextStyle(
style: const TextStyle(color: Colors.white, fontSize: 12),
child: Text(
'${ByteConverter(taskState.downloaded.toDouble()).toHumanReadable(SizeUnit.MB)}/'
'${ByteConverter(taskState.total.toDouble()).toHumanReadable(SizeUnit.MB)}',
'${ByteConverter(taskState.downloaded.toDouble()).toHumanReadable(SizeUnit.MB)}'
'${_getTotalSizeText()}',
softWrap: CommonTextStyle.defaultSoftWrap,
overflow: CommonTextStyle.defaultTextOverFlow,
maxLines: 1,
@@ -96,4 +96,12 @@ class DownloadTaskItemWidget extends StatelessWidget {
),
);
}
String _getTotalSizeText() {
if (taskState.total == 0) {
return '';
} else {
return '/${ByteConverter(taskState.total.toDouble()).toHumanReadable(SizeUnit.MB)}';
}
}
}