TF-32 Add presentation layer of download attachment for android platform
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_body_part.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/model/attachment_file.dart';
|
||||
import 'package:model/model.dart';
|
||||
|
||||
extension EmailBodyPartExtension on EmailBodyPart {
|
||||
AttachmentFile toAttachmentFile() => AttachmentFile(partId, blobId, size, name, type, cid);
|
||||
Attachment toAttachment() => Attachment(partId, blobId, size, name, type, cid);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_body_part.dart';
|
||||
import 'package:model/email/email_content.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/constants/email_constants.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/model/attachment_file.dart';
|
||||
import 'package:model/model.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/model/message_content.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/model/text_format.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/extensions/email_body_part_extension.dart';
|
||||
@@ -27,21 +27,21 @@ extension EmailContentExtension on EmailContent {
|
||||
return listMessageContent;
|
||||
}
|
||||
|
||||
List<AttachmentFile> getListAttachment() {
|
||||
List<Attachment> getListAttachment() {
|
||||
if (attachments != null) {
|
||||
return attachments!
|
||||
.where((element) => (element.disposition != null && element.disposition != 'inline'))
|
||||
.map((item) => item.toAttachmentFile())
|
||||
.map((item) => item.toAttachment())
|
||||
.toList();
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
List<AttachmentFile> getListAttachmentInline() {
|
||||
List<Attachment> getListAttachmentInline() {
|
||||
if (attachments != null) {
|
||||
return attachments!
|
||||
.where((element) => element.disposition == 'inline')
|
||||
.map((item) => item.toAttachmentFile())
|
||||
.map((item) => item.toAttachment())
|
||||
.toList();
|
||||
}
|
||||
return [];
|
||||
|
||||
Reference in New Issue
Block a user