TF-2644 Display warning dialog when pick file exceeded maximum size in composer

This commit is contained in:
dab246
2024-03-01 00:36:46 +07:00
committed by Dat H. Pham
parent 0e57da59e1
commit 4350a2bd3a
11 changed files with 177 additions and 44 deletions
@@ -6,7 +6,7 @@ import 'package:model/extensions/attachment_extension.dart';
extension ListAttachmentExtension on List<Attachment> {
num totalSize() {
num get totalSize {
if (isNotEmpty) {
final currentListSize = map((attachment) => attachment.size?.value ?? 0).toList();
final totalSize = currentListSize.reduce((sum, size) => sum + size);