TF-644 Update new icon for attachment
@@ -0,0 +1,4 @@
|
||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.0541 0H2.75C1.23118 0 0 1.2375 0 2.75V41.25C0 42.7625 1.2375 44 2.75 44H41.25C42.7688 44 44 42.7688 44 41.25V9.94592C41.0666 7.0125 35.475 1.43 34.045 0H34.0541Z" fill="#74B5E3"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.1 0L44 9.9H36.85C35.3312 9.9 34.1 8.66883 34.1 7.15V0ZM12.925 13.7506H16.176L18.0111 24.5448L20.449 13.75H23.5906L25.5535 24.3925L27.4532 16.4989H25.5805V13.75H31.075L27.121 30.2583H23.986L21.8652 20.6459L19.657 30.2561H16.3232L12.925 13.7506Z" fill="#3955B8"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 651 B |
@@ -0,0 +1,4 @@
|
||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.75 0H41.25C42.7688 0 44 1.2375 44 2.75V41.25C44 42.7688 42.7688 44 41.25 44H2.75C1.23118 44 0 42.7688 0 41.25V2.75C0 1.2375 1.2375 0 2.75 0Z" fill="#818C99" fill-opacity="0.12"/>
|
||||
<path d="M24.4808 12.0965C24.7777 12.1649 25.0405 12.2738 25.2989 12.4354C25.5573 12.597 25.7666 12.7666 26.3144 13.3144L29.6856 16.6856C30.2334 17.2334 30.403 17.4427 30.5646 17.7011C30.7262 17.9595 30.8351 18.2223 30.9035 18.5192C30.972 18.8162 31 19.0842 31 19.8588V27.1542C31 28.4915 30.8608 28.9764 30.5993 29.4653C30.3378 29.9542 29.9542 30.3378 29.4653 30.5993C28.9764 30.8608 28.4915 31 27.1542 31H17.8458C16.5085 31 16.0236 30.8608 15.5347 30.5993C15.0458 30.3378 14.6622 29.9542 14.4007 29.4653C14.1392 28.9764 14 28.4915 14 27.1542V15.8458C14 14.5085 14.1392 14.0236 14.4007 13.5347C14.6622 13.0458 15.0458 12.6622 15.5347 12.4007C16.0236 12.1392 16.5085 12 17.8458 12H23.1412C23.9158 12 24.1838 12.028 24.4808 12.0965ZM23.8 13.9243C23.6343 13.9243 23.5 14.0586 23.5 14.2243V18C23.5 18.2762 23.7239 18.5 24 18.5H27.7757C27.8553 18.5 27.9316 18.4684 27.9879 18.4122C28.105 18.295 28.105 18.105 27.9879 17.9879L24.0121 14.0121C23.9559 13.9559 23.8796 13.9243 23.8 13.9243Z" fill="#99A2AD"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,7 @@
|
||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.0541 0H2.75C1.23118 0 0 1.2375 0 2.75V41.25C0 42.7625 1.2375 44 2.75 44H41.25C42.7688 44 44 42.7688 44 41.25V9.94592C41.0666 7.0125 35.475 1.43 34.045 0H34.0541Z" fill="#D52E26"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.1 0L44 9.9H36.85C35.3312 9.9 34.1 8.66882 34.1 7.15V0Z" fill="#9D0700"/>
|
||||
<path d="M10.7642 26.3996V17.5996H14.5626C15.2158 17.5996 15.7873 17.7285 16.2771 17.9863C16.7669 18.2441 17.1479 18.6065 17.4201 19.0734C17.6922 19.5404 17.8283 20.0861 17.8283 20.7105C17.8283 21.3408 17.6879 21.8865 17.4072 22.3477C17.1293 22.8089 16.7383 23.1641 16.2341 23.4133C15.7328 23.6625 15.147 23.7871 14.4767 23.7871H12.208V21.9309H13.9955C14.2762 21.9309 14.5154 21.8822 14.713 21.7848C14.9136 21.6845 15.0668 21.5427 15.1728 21.3594C15.2817 21.176 15.3361 20.9598 15.3361 20.7105C15.3361 20.4585 15.2817 20.2436 15.1728 20.066C15.0668 19.8855 14.9136 19.748 14.713 19.6535C14.5154 19.5561 14.2762 19.5074 13.9955 19.5074H13.1533V26.3996H10.7642Z" fill="white"/>
|
||||
<path d="M22.0908 26.3996H18.7048V17.5996H22.0564C22.9616 17.5996 23.7436 17.7758 24.4025 18.1281C25.0642 18.4776 25.5741 18.9818 25.9322 19.6406C26.2931 20.2966 26.4736 21.0829 26.4736 21.9996C26.4736 22.9163 26.2945 23.704 25.9365 24.3629C25.5784 25.0189 25.0714 25.523 24.4154 25.8754C23.7594 26.2249 22.9845 26.3996 22.0908 26.3996ZM21.0939 24.3715H22.0048C22.4402 24.3715 22.8112 24.3013 23.1177 24.1609C23.4271 24.0206 23.662 23.7785 23.8224 23.4348C23.9857 23.091 24.0673 22.6126 24.0673 21.9996C24.0673 21.3866 23.9843 20.9082 23.8181 20.5645C23.6548 20.2207 23.4142 19.9786 23.0962 19.8383C22.7811 19.6979 22.3944 19.6277 21.9361 19.6277H21.0939V24.3715Z" fill="white"/>
|
||||
<path d="M27.579 26.3996V17.5996H33.7665V19.5246H29.968V21.0371H33.3883V22.9621H29.968V26.3996H27.579Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.75 0H41.25C42.7688 0 44 1.2375 44 2.75V41.25C44 42.7688 42.7688 44 41.25 44H2.75C1.23118 44 0 42.7688 0 41.25V2.75C0 1.2375 1.2375 0 2.75 0Z" fill="#E7DEFF"/>
|
||||
<path d="M31.898 18.4249C33.1135 18.4249 34.1 17.4602 34.1 16.2706C34.1 15.0812 33.1138 14.1162 31.898 14.1162C30.6825 14.1162 29.6964 15.0809 29.6964 16.2706C29.6964 17.4624 30.69 18.4249 31.9 18.4249H31.898ZM34.9863 28.4129L26.6923 21.2024C26.2556 20.7025 25.8612 20.8504 25.4017 21.3867L23.3785 23.5303C22.9625 24.0014 22.355 24.1504 22.0302 23.7662L17.7116 18.0627C17.2425 17.5906 16.6369 17.697 16.3647 18.2998L8.87422 28.6926C8.60197 29.2976 8.92922 29.9576 9.58922 29.9521L34.5471 29.943C35.2335 29.9474 35.42 28.9024 34.98 28.4129H34.9863Z" fill="#8400EC"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 880 B |
@@ -0,0 +1,5 @@
|
||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.0541 0H2.75C1.23118 0 0 1.2375 0 2.75V41.25C0 42.7625 1.2375 44 2.75 44H41.25C42.7688 44 44 42.7688 44 41.25V9.94592C41.0666 7.0125 35.475 1.43 34.045 0H34.0541Z" fill="#C8421D"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.1 0L44 9.9H36.85C35.3312 9.9 34.1 8.66882 34.1 7.15V0Z" fill="#A03517"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 12V33H18.3077V25.4211H23.4615C27.0726 25.4211 30 22.4166 30 18.7105C30 15.0044 27.0726 12 23.4615 12H14ZM18.3077 22.2632V15.1579H22.5385C24.4502 15.1579 26 16.7485 26 18.7105C26 20.6726 24.4502 22.2632 22.5385 22.2632H18.3077Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 758 B |
@@ -0,0 +1,4 @@
|
||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.0541 0H2.75C1.23118 0 0 1.2375 0 2.75V41.25C0 42.7625 1.2375 44 2.75 44H41.25C42.7688 44 44 42.7688 44 41.25V9.94592C41.0666 7.0125 35.475 1.43 34.045 0H34.0541Z" fill="#5CBB6C"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.1 0L44 9.9H36.85C35.3312 9.9 34.1 8.66883 34.1 7.15V0ZM14.0415 13.7511H18.997L22.0201 18.3948L25.115 13.7692H30.0001L24.2212 21.5886L30.2575 30.2318H25.7565L21.9698 24.8198L19.8042 28.0437L21.9992 28.0464V30.2492H13.7432L19.7481 21.6389L14.0418 13.7511H14.0415Z" fill="#00660A"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 669 B |
@@ -0,0 +1,8 @@
|
||||
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.75 0H41.25C42.7688 0 44 1.2375 44 2.75V41.25C44 42.7688 42.7688 44 41.25 44H2.75C1.23118 44 0 42.7688 0 41.25V2.75C0 1.2375 1.2375 0 2.75 0Z" fill="#F1C569"/>
|
||||
<path d="M21.863 32.0727C23.727 32.0678 25.2494 30.5821 25.3 28.7188L24.4485 21.336C24.3498 20.3762 23.5543 19.6385 22.5898 19.6123H21.1257C20.1821 19.6343 19.3943 20.3385 19.267 21.2737L18.426 28.5423C18.4036 29.4691 18.7555 30.3658 19.4022 31.0301C20.0489 31.6944 20.9359 32.0702 21.863 32.0727ZM20.0354 28.48L20.1185 27.7323C20.1888 26.8238 20.9465 26.1224 21.8578 26.1224C22.769 26.1224 23.5268 26.8238 23.597 27.7323L23.6801 28.48C23.7414 28.9037 23.6128 29.3328 23.3286 29.653C23.0445 29.9732 22.6336 30.1519 22.2056 30.1414H21.5099C21.0725 30.1509 20.6538 29.9643 20.3684 29.6326C20.083 29.301 19.9609 28.8592 20.0354 28.4281V28.48ZM20.8246 22.5405V22.1148C20.8761 21.6173 21.2953 21.2392 21.7955 21.2392C22.2956 21.2392 22.7148 21.6173 22.7663 22.1148L22.8183 22.5405C22.8522 22.778 22.7792 23.0183 22.6188 23.1967C22.4585 23.3751 22.2273 23.4732 21.9876 23.4647H21.6034C21.3727 23.4581 21.1557 23.3534 21.007 23.177C20.8583 23.0005 20.792 22.769 20.8246 22.5405Z" fill="white"/>
|
||||
<path d="M21.4527 11.8252H19.9678C19.5234 11.8252 19.1631 12.1855 19.1631 12.6299C19.1631 13.0744 19.5234 13.4347 19.9678 13.4347H21.4527C21.8971 13.4347 22.2574 13.0744 22.2574 12.6299C22.2574 12.1855 21.8971 11.8252 21.4527 11.8252Z" fill="white"/>
|
||||
<path d="M23.1037 13.4346H21.6188C21.1744 13.4346 20.8141 13.7949 20.8141 14.2393C20.8141 14.6837 21.1744 15.044 21.6188 15.044H23.1037C23.5481 15.044 23.9084 14.6837 23.9084 14.2393C23.9084 13.7949 23.5481 13.4346 23.1037 13.4346Z" fill="white"/>
|
||||
<path d="M21.4527 15.0332H19.9678C19.5234 15.0332 19.1631 15.3935 19.1631 15.8379C19.1631 16.2824 19.5234 16.6427 19.9678 16.6427H21.4527C21.8971 16.6427 22.2574 16.2824 22.2574 15.8379C22.2574 15.3935 21.8971 15.0332 21.4527 15.0332Z" fill="white"/>
|
||||
<path d="M23.1037 16.6426H21.6188C21.1744 16.6426 20.8141 17.0029 20.8141 17.4473C20.8141 17.8918 21.1744 18.252 21.6188 18.252H23.1037C23.5481 18.252 23.9084 17.8918 23.9084 17.4473C23.9084 17.0029 23.5481 16.6426 23.1037 16.6426Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -9,5 +9,15 @@ extension MediaTypeExtension on MediaType {
|
||||
|
||||
bool isImageFile() => SupportedPreviewFileTypes.imageMimeTypes.contains(mimeType);
|
||||
|
||||
bool isDocFile() => SupportedPreviewFileTypes.docMimeTypes.contains(mimeType);
|
||||
|
||||
bool isPowerPointFile() => SupportedPreviewFileTypes.pptMimeTypes.contains(mimeType);
|
||||
|
||||
bool isExcelFile() => SupportedPreviewFileTypes.xlsMimeTypes.contains(mimeType);
|
||||
|
||||
bool isZipFile() => SupportedPreviewFileTypes.zipMimeTypes.contains(mimeType);
|
||||
|
||||
bool isPdfFile() => SupportedPreviewFileTypes.pdfMimeTypes.contains(mimeType);
|
||||
|
||||
DocumentUti getDocumentUti() => DocumentUti(SupportedPreviewFileTypes.iOSSupportedTypes[mimeType]);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,41 @@ class SupportedPreviewFileTypes {
|
||||
'image/gif',
|
||||
'image/png',];
|
||||
|
||||
static const docMimeTypes = [
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
'application/vnd.oasis.opendocument.text',
|
||||
'application/vnd.oasis.opendocument.text-template',
|
||||
'application/vnd.oasis.opendocument.text-web',
|
||||
'application/vnd.oasis.opendocument.text-master',
|
||||
'application/msword',
|
||||
'application/vnd.ms-works'];
|
||||
|
||||
static const pdfMimeTypes = [
|
||||
'application/pdf',
|
||||
'application/rtf'];
|
||||
|
||||
static const xlsMimeTypes = [
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
'application/vnd.oasis.opendocument.spreadsheet',
|
||||
'application/vnd.oasis.opendocument.spreadsheet-template',
|
||||
'application/vnd.oasis.opendocument.chart',
|
||||
'application/vnd.oasis.opendocument.formula',
|
||||
'application/vnd.ms-excel'];
|
||||
|
||||
static const pptMimeTypes = [
|
||||
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||
'application/vnd.oasis.opendocument.presentation',
|
||||
'application/vnd.oasis.opendocument.presentation-template',
|
||||
'application/vnd.ms-powerpoint'];
|
||||
|
||||
static const zipMimeTypes = [
|
||||
'application/x-tar',
|
||||
'application/x-gtar',
|
||||
'application/x-gzip',
|
||||
'application/x-compressed',
|
||||
'application/x-zip-compressed',
|
||||
'application/java-archive'];
|
||||
|
||||
static const iOSSupportedTypes = {
|
||||
'text/plain' : 'public.plain-text',
|
||||
'text/html' : 'public.html',
|
||||
|
||||
@@ -118,6 +118,13 @@ class ImagePaths {
|
||||
String get icSelectedSB => _getImagePath('ic_selected_sb.svg');
|
||||
String get icUserSB => _getImagePath('ic_user_sb.svg');
|
||||
String get icComposeWeb => _getImagePath('ic_compose_web.svg');
|
||||
String get icFileDocx => _getImagePath('ic_file_docx.svg');
|
||||
String get icFileZip => _getImagePath('ic_file_zip.svg');
|
||||
String get icFileXlsx => _getImagePath('ic_file_xlsx.svg');
|
||||
String get icFilePng => _getImagePath('ic_file_png.svg');
|
||||
String get icFilePdf => _getImagePath('ic_file_pdf.svg');
|
||||
String get icFilePptx => _getImagePath('ic_file_pptx.svg');
|
||||
String get icFileEPup => _getImagePath('ic_file_epup.svg');
|
||||
|
||||
String _getImagePath(String imageName) {
|
||||
return AssetsPaths.images + imageName;
|
||||
|
||||
@@ -479,6 +479,7 @@ class EmailView extends GetView with NetworkConnectionMixin {
|
||||
icon: SvgPicture.asset(imagePaths.icExpandAttachment,
|
||||
width: 20,
|
||||
height: 20,
|
||||
color: AppColor.primaryColor,
|
||||
fit: BoxFit.fill),
|
||||
onPressed: () => emailController.toggleDisplayAttachmentsAction()
|
||||
))
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:model/email/attachment.dart';
|
||||
|
||||
extension AttachmentExtension on Attachment {
|
||||
|
||||
String getIcon(ImagePaths imagePaths) {
|
||||
final mediaType = type;
|
||||
log('AttachmentExtension::getIcon(): mediaType: $mediaType');
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import 'package:filesize/filesize.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:model/model.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/extensions/attachment_extension.dart';
|
||||
|
||||
typedef OnDownloadAttachmentFileActionClick = void Function(Attachment attachment);
|
||||
typedef OnExpandAttachmentActionClick = void Function();
|
||||
@@ -59,6 +60,7 @@ class AttachmentFileTileBuilder {
|
||||
alignment: Alignment.center,
|
||||
margin: EdgeInsets.only(top:heightItem != null ? 8 : 0),
|
||||
height: heightItem,
|
||||
padding: EdgeInsets.zero,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.attachmentFileBorderColor),
|
||||
@@ -76,11 +78,19 @@ class AttachmentFileTileBuilder {
|
||||
if (_onDownloadAttachmentFileActionClick != null) {
|
||||
_onDownloadAttachmentFileActionClick!(_attachment);
|
||||
}},
|
||||
leading: Transform(
|
||||
transform: Matrix4.translationValues(14.0, 2.0, 0.0),
|
||||
child: SvgPicture.asset(_imagePaths.icFileAttachment, width: 24, height: 24, fit: BoxFit.fill)),
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.only(left: 8, bottom: BuildUtils.isWeb ? 6 : 14),
|
||||
child: SvgPicture.asset(
|
||||
_attachment.getIcon(_imagePaths),
|
||||
width: 44,
|
||||
height: 44,
|
||||
fit: BoxFit.fill),
|
||||
),
|
||||
title: Transform(
|
||||
transform: Matrix4.translationValues(-8.0, -8.0, 0.0),
|
||||
transform: Matrix4.translationValues(
|
||||
BuildUtils.isWeb ? 0.0 : -8.0,
|
||||
BuildUtils.isWeb ? -8.0 : -10.0,
|
||||
0.0),
|
||||
child: Text(
|
||||
_attachment.name ?? '',
|
||||
maxLines: 1,
|
||||
@@ -89,7 +99,10 @@ class AttachmentFileTileBuilder {
|
||||
)),
|
||||
subtitle: _attachment.size != null && _attachment.size?.value != 0
|
||||
? Transform(
|
||||
transform: Matrix4.translationValues(-8.0, -8.0, 0.0),
|
||||
transform: Matrix4.translationValues(
|
||||
BuildUtils.isWeb ? 0.0 : -8.0,
|
||||
BuildUtils.isWeb ? -8.0 : -10.0,
|
||||
0.0),
|
||||
child: Text(
|
||||
filesize(_attachment.size?.value),
|
||||
maxLines: 1,
|
||||
@@ -106,7 +119,12 @@ class AttachmentFileTileBuilder {
|
||||
Transform(
|
||||
transform: Matrix4.translationValues(5.0, 5.0, 0.0),
|
||||
child: IconButton(
|
||||
icon: SvgPicture.asset(_imagePaths.icDownload, width: 24, height: 24, fit: BoxFit.fill),
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icDownload,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: AppColor.primaryColor,
|
||||
fit: BoxFit.fill),
|
||||
onPressed: () {
|
||||
if (_onDownloadAttachmentFileActionClick != null) {
|
||||
_onDownloadAttachmentFileActionClick!(_attachment);
|
||||
|
||||