Fix toast message when sending a message

This commit is contained in:
dab246
2022-04-07 15:44:01 +07:00
committed by Dat H. Pham
parent a7d013cfc7
commit 3eb5f31dcd
6 changed files with 31 additions and 23 deletions
@@ -3,9 +3,12 @@ import 'package:model/model.dart';
extension ListAttachmentExtension on List<Attachment> {
num totalSize() {
final currentListSize = map((attachment) => attachment.size?.value ?? 0).toList();
final totalSize = currentListSize.reduce((sum, size) => sum + size);
return totalSize;
if (isNotEmpty) {
final currentListSize = map((attachment) => attachment.size?.value ?? 0).toList();
final totalSize = currentListSize.reduce((sum, size) => sum + size);
return totalSize;
}
return 0;
}
List<Attachment> get listAttachmentsDisplayedOutSide {