TF-56 Send email with attachment
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:core/core.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/usecases/send_email_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/email/data/datasource/email_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/email/data/datasource_impl/email_datasource_impl.dart';
|
||||
import 'package:tmail_ui_user/features/email/data/network/email_api.dart';
|
||||
@@ -21,6 +22,7 @@ class EmailBindings extends Bindings {
|
||||
Get.lazyPut<EmailDataSource>(() => Get.find<EmailDataSourceImpl>());
|
||||
Get.lazyPut(() => EmailRepositoryImpl(Get.find<EmailDataSource>()));
|
||||
Get.lazyPut<EmailRepository>(() => Get.find<EmailRepositoryImpl>());
|
||||
Get.put(SendEmailInteractor(Get.find<EmailRepository>()));
|
||||
Get.lazyPut(() => GetEmailContentInteractor(Get.find<EmailRepository>()));
|
||||
Get.lazyPut(() => MarkAsEmailReadInteractor(Get.find<EmailRepository>()));
|
||||
Get.lazyPut(() => CredentialRepositoryImpl(Get.find<SharedPreferences>()));
|
||||
|
||||
@@ -204,7 +204,7 @@ class EmailController extends BaseController {
|
||||
..actionText(AppLocalizations.of(context).cancel)
|
||||
..addCancelDownloadActionClick(() {
|
||||
cancelToken.cancel([AppLocalizations.of(context).user_cancel_download_file]);
|
||||
Get.back();
|
||||
popBack();
|
||||
}))
|
||||
.build());
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_body_part.dart';
|
||||
import 'package:model/model.dart';
|
||||
|
||||
extension EmailBodyPartExtension on EmailBodyPart {
|
||||
Attachment toAttachment() => Attachment(
|
||||
partId: partId,
|
||||
blobId: blobId,
|
||||
size: size,
|
||||
name: name,
|
||||
type: type,
|
||||
cid: cid);
|
||||
}
|
||||
@@ -3,7 +3,6 @@ import 'package:tmail_ui_user/features/email/presentation/constants/email_consta
|
||||
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';
|
||||
|
||||
extension EmailContentExtension on EmailContent {
|
||||
|
||||
|
||||
@@ -99,20 +99,21 @@ class AttachmentFileTileBuilder {
|
||||
: null,
|
||||
trailing: buttonAction != null
|
||||
? Transform(
|
||||
transform: Matrix4.translationValues(6.0, heightItem != null ? -6.0 : 0.0, 0.0),
|
||||
transform: Matrix4.translationValues(-5.0, heightItem != null ? -6.0 : 0.0, 0.0),
|
||||
child: buttonAction)
|
||||
: null
|
||||
),
|
||||
Transform(
|
||||
transform: Matrix4.translationValues(5.0, 5.0, 0.0),
|
||||
child: IconButton(
|
||||
icon: SvgPicture.asset(_imagePaths.icDownload, width: 24, height: 24, fit: BoxFit.fill),
|
||||
onPressed: () {
|
||||
if (_onDownloadAttachmentFileActionClick != null) {
|
||||
_onDownloadAttachmentFileActionClick!(_attachment);
|
||||
if (buttonAction == null)
|
||||
Transform(
|
||||
transform: Matrix4.translationValues(5.0, 5.0, 0.0),
|
||||
child: IconButton(
|
||||
icon: SvgPicture.asset(_imagePaths.icDownload, width: 24, height: 24, fit: BoxFit.fill),
|
||||
onPressed: () {
|
||||
if (_onDownloadAttachmentFileActionClick != null) {
|
||||
_onDownloadAttachmentFileActionClick!(_attachment);
|
||||
}
|
||||
}
|
||||
}
|
||||
)),
|
||||
)),
|
||||
if (_attachmentSize > _limitDisplayAttachment && _expandMode == ExpandMode.COLLAPSE) _buildItemBackground()
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user