TF-4075 Change attachments location

(cherry picked from commit ab23dac45d9dcf7c5e057f8e16974b3ed8205771)
This commit is contained in:
dab246
2025-10-06 19:17:25 +07:00
committed by Dat H. Pham
parent 993b05fbc2
commit 6bbebd8e67
31 changed files with 540 additions and 486 deletions
@@ -1,5 +1,6 @@
import 'package:core/data/constants/constant.dart';
import 'package:core/presentation/extensions/media_type_extension.dart';
import 'package:core/presentation/model/file_category.dart';
import 'package:core/presentation/resources/image_paths.dart';
import 'package:core/utils/platform_info.dart';
import 'package:model/download/download_task_id.dart';
@@ -8,7 +9,7 @@ import 'package:tmail_ui_user/main/routes/app_routes.dart';
import 'package:tmail_ui_user/main/routes/route_utils.dart';
extension AttachmentExtension on Attachment {
String getIcon(ImagePaths imagePaths) => type?.getIcon(imagePaths, fileName: name) ?? imagePaths.icFileEPup;
String getIcon(ImagePaths imagePaths) => type?.getIcon(imagePaths, fileName: name) ?? imagePaths.icFileDefault;
bool get isPDFFile => type?.isPDFFile(fileName: name) ?? false;
@@ -41,11 +42,9 @@ extension AttachmentExtension on Attachment {
bool get isHTMLFile => type?.isHTMLFile(fileName: name) ?? false;
bool get isImage => type?.isImageSupportedPreview(fileName: name) ?? false;
bool get isImage => type?.getFileCategory(fileName: name) == FileCategory.image;
bool get isText => (type?.isTextFile() ?? false)
|| name?.endsWith('.txt') == true
|| name?.endsWith('.md') == true;
bool get isText => type?.getFileCategory(fileName: name) == FileCategory.text;
bool get isJson => (type?.isJsonFile() ?? false)
|| name?.endsWith('.json') == true;