TF-3450 Refactor image and text preview
This commit is contained in:
@@ -3,6 +3,7 @@ class SupportedPreviewFileTypes {
|
||||
'image/bmp',
|
||||
'image/jpeg',
|
||||
'image/gif',
|
||||
'image/webp',
|
||||
'image/png',];
|
||||
|
||||
static const textMimeTypes = [
|
||||
@@ -10,6 +11,10 @@ class SupportedPreviewFileTypes {
|
||||
'text/markdown',
|
||||
];
|
||||
|
||||
static const jsonMimeTypes = [
|
||||
'application/json',
|
||||
];
|
||||
|
||||
static const docMimeTypes = [
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
'application/vnd.oasis.opendocument.text',
|
||||
|
||||
@@ -23,6 +23,8 @@ extension MediaTypeExtension on MediaType {
|
||||
|
||||
bool isTextFile() => SupportedPreviewFileTypes.textMimeTypes.contains(mimeType);
|
||||
|
||||
bool isJsonFile() => SupportedPreviewFileTypes.jsonMimeTypes.contains(mimeType);
|
||||
|
||||
DocumentUti getDocumentUti() => DocumentUti(SupportedPreviewFileTypes.iOSSupportedTypes[mimeType]);
|
||||
|
||||
String getIcon(ImagePaths imagePaths, {String? fileName}) {
|
||||
|
||||
Reference in New Issue
Block a user