From b60272b2e9795a5b1840ab82468ae3310ba3e407 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 6 Jul 2023 14:47:15 +0300 Subject: [PATCH] Support more image formats --- lib/data/models/document_model.dart | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/data/models/document_model.dart b/lib/data/models/document_model.dart index 6764fa685..2ea1c1800 100644 --- a/lib/data/models/document_model.dart +++ b/lib/data/models/document_model.dart @@ -142,8 +142,14 @@ abstract class DocumentEntity extends Object String get downloadUrl => '/documents/$hash'; - bool get isImage => - name.endsWith('.png') || name.endsWith('.jpg') || name.endsWith('.jpeg'); + bool get isImage { + final fileName = name.toLowerCase(); + return fileName.endsWith('.png') || + fileName.endsWith('.jpg') || + fileName.endsWith('.jpeg') || + fileName.endsWith('.bmp') || + fileName.endsWith('.webp'); + } int compareTo(DocumentEntity document, [String sortField, bool sortAscending = true]) {