TF-644 Update new icon for attachment

This commit is contained in:
dab246
2022-06-14 11:45:33 +07:00
committed by Dat H. Pham
parent 99a4b1d9d2
commit a1061e1489
13 changed files with 141 additions and 6 deletions
@@ -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;
}
}