TF-675 Add UploadController to handle upload attachment

This commit is contained in:
dab246
2022-07-05 19:31:57 +07:00
committed by Dat H. Pham
parent 87beef9230
commit 91bc3018ea
5 changed files with 406 additions and 0 deletions
@@ -0,0 +1,13 @@
import 'package:tmail_ui_user/features/upload/presentation/model/upload_file_state.dart';
extension ListUploadFileStateExtension on List<UploadFileState> {
num get totalSize {
if (isNotEmpty) {
final currentListSize = map((file) => file.fileSize).toList();
final totalSize = currentListSize.reduce((sum, size) => sum + size);
return totalSize;
}
return 0;
}
}