diff --git a/lib/ui/thumbnail_widget.dart b/lib/ui/thumbnail_widget.dart index f51097d6e..8fcc185c7 100644 --- a/lib/ui/thumbnail_widget.dart +++ b/lib/ui/thumbnail_widget.dart @@ -39,30 +39,26 @@ class _ThumbnailWidgetState extends State { } }); } else { - Future.delayed(Duration(milliseconds: 1000), () { + widget.photo + .getAsset() + .thumbDataWithSize(THUMBNAIL_SMALL_SIZE, THUMBNAIL_SMALL_SIZE) + .then((data) { if (mounted) { - widget.photo - .getAsset() - .thumbDataWithSize(THUMBNAIL_SMALL_SIZE, THUMBNAIL_SMALL_SIZE) - .then((data) { - if (mounted) { - setState(() { - if (data != null) { - final imageProvider = Image.memory(data).image; - precacheImage(imageProvider, context).then((value) { - if (mounted) { - setState(() { - _imageProvider = imageProvider; - _hasLoadedThumbnail = true; - }); - } + setState(() { + if (data != null) { + final imageProvider = Image.memory(data).image; + precacheImage(imageProvider, context).then((value) { + if (mounted) { + setState(() { + _imageProvider = imageProvider; + _hasLoadedThumbnail = true; }); } }); } - ThumbnailLruCache.put(widget.photo, THUMBNAIL_SMALL_SIZE, data); }); } + ThumbnailLruCache.put(widget.photo, THUMBNAIL_SMALL_SIZE, data); }); } }