Skip to content

An open-source cross-platform alternative to AirDrop

fix: keep ratio in image thumbnail

Tien Do Namdd3900e8e0eb
diff --git a/lib/widget/file_thumbnail.dart b/lib/widget/file_thumbnail.dart
index 3d02d08a..506807b3 100644
--- a/lib/widget/file_thumbnail.dart
+++ b/lib/widget/file_thumbnail.dart
@@ -23,9 +23,7 @@ class FileThumbnail extends StatelessWidget {
} else if (file.path != null && file.fileType == FileType.image) {
thumbnail = Image.file(
File(file.path!),
- fit: BoxFit.fill,
- cacheWidth: 64, // reduce memory with low cached size
- cacheHeight: 64,
+ cacheWidth: 64, // reduce memory with low cached size; do not set cacheHeight because the image must keep its ratio
);
}