Explorar o código

Load full image if thumbnail isn't available

Vishnu Mohandas %!s(int64=5) %!d(string=hai) anos
pai
achega
1e336897d4
Modificáronse 1 ficheiros con 6 adicións e 5 borrados
  1. 6 5
      lib/ui/thumbnail_widget.dart

+ 6 - 5
lib/ui/thumbnail_widget.dart

@@ -89,11 +89,12 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
   }
 
   void _loadNetworkImage() {
-    _imageProvider = Image.network(Configuration.instance.getHttpEndpoint() +
-                "/" +
-                widget.photo.thumbnailPath ??
-            widget.photo.remotePath)
-        .image;
+    final path = widget.photo.thumbnailPath.isNotEmpty
+        ? widget.photo.thumbnailPath
+        : widget.photo.remotePath;
+    _imageProvider =
+        Image.network(Configuration.instance.getHttpEndpoint() + "/" + path)
+            .image;
   }
 
   @override