TF-4075 Change attachments location
(cherry picked from commit ab23dac45d9dcf7c5e057f8e16974b3ed8205771)
This commit is contained in:
@@ -233,6 +233,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
List<String>? emailAddressSender,
|
||||
ScrollController? scrollController,
|
||||
}) {
|
||||
final isMobile = controller.responsiveUtils.isMobile(context);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -285,8 +286,8 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
controller.mailboxDashBoardController.mapMailboxById,
|
||||
),
|
||||
)),
|
||||
if (!controller.responsiveUtils.isMobile(context))
|
||||
const SizedBox(height: 24),
|
||||
if (!isMobile)
|
||||
const SizedBox(height: 16),
|
||||
Obx(() => MailUnsubscribedBanner(
|
||||
presentationEmail: controller.currentEmail,
|
||||
emailUnsubscribe: controller.emailUnsubscribe.value
|
||||
@@ -294,6 +295,8 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
Obx(() => EmailViewLoadingBarWidget(
|
||||
viewState: controller.emailLoadedViewState.value
|
||||
)),
|
||||
if (!isMobile)
|
||||
_buildAttachmentsList(context),
|
||||
if (calendarEvent != null)
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -437,46 +440,51 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
height: 5,
|
||||
color: Colors.transparent,
|
||||
),
|
||||
Obx(() {
|
||||
if (controller.attachments.isNotEmpty) {
|
||||
return EmailAttachmentsWidget(
|
||||
responsiveUtils: controller.responsiveUtils,
|
||||
attachments: controller.attachments,
|
||||
imagePaths: controller.imagePaths,
|
||||
onDragStarted: controller
|
||||
.mailboxDashBoardController.enableAttachmentDraggableApp,
|
||||
onDragEnd: (_) {
|
||||
controller
|
||||
.mailboxDashBoardController
|
||||
.disableAttachmentDraggableApp();
|
||||
},
|
||||
downloadAttachmentAction: (attachment) =>
|
||||
controller.handleDownloadAttachmentAction(attachment),
|
||||
viewAttachmentAction: (attachment) =>
|
||||
controller.handleViewAttachmentAction(
|
||||
context,
|
||||
attachment,
|
||||
),
|
||||
onTapShowAllAttachmentFile: () => controller.openAttachmentList(
|
||||
context,
|
||||
controller.attachments,
|
||||
),
|
||||
showDownloadAllAttachmentsButton:
|
||||
controller.downloadAllButtonIsEnabled(),
|
||||
onTapDownloadAllButton: () =>
|
||||
controller.handleDownloadAllAttachmentsAction(
|
||||
'TwakeMail-${DateTime.now()}',
|
||||
),
|
||||
singleEmailControllerTag: tag,
|
||||
);
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}),
|
||||
if (isMobile)
|
||||
_buildAttachmentsList(context),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAttachmentsList(BuildContext context) {
|
||||
return Obx(() {
|
||||
if (controller.attachments.isNotEmpty) {
|
||||
return EmailAttachmentsWidget(
|
||||
responsiveUtils: controller.responsiveUtils,
|
||||
attachments: controller.attachments,
|
||||
imagePaths: controller.imagePaths,
|
||||
onDragStarted: controller
|
||||
.mailboxDashBoardController.enableAttachmentDraggableApp,
|
||||
onDragEnd: (_) {
|
||||
controller
|
||||
.mailboxDashBoardController
|
||||
.disableAttachmentDraggableApp();
|
||||
},
|
||||
downloadAttachmentAction: (attachment) =>
|
||||
controller.handleDownloadAttachmentAction(attachment),
|
||||
viewAttachmentAction: (attachment) =>
|
||||
controller.handleViewAttachmentAction(
|
||||
context,
|
||||
attachment,
|
||||
),
|
||||
onTapShowAllAttachmentFile: () => controller.openAttachmentList(
|
||||
context,
|
||||
controller.attachments,
|
||||
),
|
||||
showDownloadAllAttachmentsButton:
|
||||
controller.downloadAllButtonIsEnabled(),
|
||||
onTapDownloadAllButton: () =>
|
||||
controller.handleDownloadAllAttachmentsAction(
|
||||
'TwakeMail-${DateTime.now()}',
|
||||
),
|
||||
singleEmailControllerTag: tag,
|
||||
);
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bool _validateDisplayEventActionBanner({
|
||||
required BuildContext context,
|
||||
required CalendarEvent event,
|
||||
|
||||
Reference in New Issue
Block a user