TF-2644 Handle total size exceeded maximum size when drag & drop multiple file to composer
This commit is contained in:
@@ -339,9 +339,9 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
responsiveUtils: controller.responsiveUtils,
|
||||
attachments: controller.attachments,
|
||||
imagePaths: controller.imagePaths,
|
||||
onDragStarted: controller.mailboxDashBoardController.enableDraggableApp,
|
||||
onDragStarted: controller.mailboxDashBoardController.enableAttachmentDraggableApp,
|
||||
onDragEnd: (details) {
|
||||
controller.mailboxDashBoardController.disableDraggableApp();
|
||||
controller.mailboxDashBoardController.disableAttachmentDraggableApp();
|
||||
},
|
||||
downloadAttachmentAction: (attachment) => controller.handleDownloadAttachmentAction(context, attachment),
|
||||
viewAttachmentAction: (attachment) => controller.handleViewAttachmentAction(context, attachment),
|
||||
@@ -376,7 +376,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
Obx(() => CalendarEventDetailWidget(
|
||||
calendarEvent: calendarEvent,
|
||||
emailContent: controller.currentEmailLoaded?.htmlContent ?? '',
|
||||
isDraggableAppActive: controller.mailboxDashBoardController.isDraggableAppActive,
|
||||
isDraggableAppActive: controller.mailboxDashBoardController.isAttachmentDraggableAppActive,
|
||||
onOpenComposerAction: controller.openNewComposerAction,
|
||||
onOpenNewTabAction: controller.openNewTabAction,
|
||||
onMailtoDelegateAction: controller.openMailToLink,
|
||||
@@ -407,7 +407,14 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
mailtoDelegate: controller.openMailToLink,
|
||||
direction: AppUtils.getCurrentDirection(context),
|
||||
),
|
||||
if (controller.mailboxDashBoardController.isDraggableAppActive)
|
||||
if (controller.mailboxDashBoardController.isAttachmentDraggableAppActive)
|
||||
PointerInterceptor(
|
||||
child: SizedBox(
|
||||
width: constraints.maxWidth,
|
||||
height: constraints.maxHeight,
|
||||
)
|
||||
),
|
||||
if (controller.mailboxDashBoardController.isLocalFileDraggableAppActive)
|
||||
PointerInterceptor(
|
||||
child: SizedBox(
|
||||
width: constraints.maxWidth,
|
||||
|
||||
@@ -1,38 +1,7 @@
|
||||
import 'package:core/data/constants/constant.dart';
|
||||
import 'package:core/domain/extensions/media_type_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:http_parser/http_parser.dart';
|
||||
import 'package:model/email/attachment.dart';
|
||||
import 'package:tmail_ui_user/features/upload/domain/extensions/media_type_extension.dart';
|
||||
|
||||
extension AttachmentExtension on Attachment {
|
||||
|
||||
String getIcon(ImagePaths imagePaths, {MediaType? fileMediaType}) {
|
||||
final mediaType = type ?? fileMediaType;
|
||||
|
||||
if (isDisplayedPDFIcon) {
|
||||
return imagePaths.icFilePdf;
|
||||
}
|
||||
|
||||
if (mediaType == null) {
|
||||
return imagePaths.icFileEPup;
|
||||
}
|
||||
if (mediaType.isDocFile()) {
|
||||
return imagePaths.icFileDocx;
|
||||
} else if (mediaType.isExcelFile()) {
|
||||
return imagePaths.icFileXlsx;
|
||||
} else if (mediaType.isPowerPointFile()) {
|
||||
return imagePaths.icFilePptx;
|
||||
} else if (mediaType.isPdfFile()) {
|
||||
return imagePaths.icFilePdf;
|
||||
} else if (mediaType.isZipFile()) {
|
||||
return imagePaths.icFileZip;
|
||||
} else if (mediaType.isImageFile()) {
|
||||
return imagePaths.icFilePng;
|
||||
}
|
||||
return imagePaths.icFileEPup;
|
||||
}
|
||||
|
||||
bool get isDisplayedPDFIcon => type?.mimeType == Constant.pdfMimeType
|
||||
|| (type?.mimeType == Constant.octetStreamMimeType
|
||||
&& name?.endsWith(Constant.pdfExtension) == true);
|
||||
String getIcon(ImagePaths imagePaths) => type?.getIcon(imagePaths, fileName: name) ?? imagePaths.icFileEPup;
|
||||
}
|
||||
Reference in New Issue
Block a user