Support more image formats

This commit is contained in:
Hillel Coren 2023-07-06 14:47:15 +03:00
parent e82cc82556
commit b60272b2e9
1 changed files with 8 additions and 2 deletions

View File

@ -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]) {