From d7c18069ceadfdcfc81dfc871bb605ab6b5ef0a8 Mon Sep 17 00:00:00 2001 From: Vishnu Mohandas Date: Tue, 23 Jun 2020 23:24:18 +0530 Subject: [PATCH] Reuse the cached thumbnail if available within the detail view --- lib/ui/zoomable_image.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/ui/zoomable_image.dart b/lib/ui/zoomable_image.dart index 20cb0201b..7dbfbeb18 100644 --- a/lib/ui/zoomable_image.dart +++ b/lib/ui/zoomable_image.dart @@ -1,3 +1,4 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:logging/logging.dart'; @@ -68,10 +69,8 @@ class _ZoomableImageState extends State void _loadNetworkImage() { if (!_loadedSmallThumbnail && widget.photo.previewURL.isNotEmpty) { - _imageProvider = Image.network( - widget.photo.getThumbnailUrl(), - gaplessPlayback: true, - ).image; + _imageProvider = + CachedNetworkImageProvider(widget.photo.getThumbnailUrl()); _loadedSmallThumbnail = true; } if (!_loadedFinalImage) {