From 63f90ca519e9a1a11a28ca003aee5bb2880dfc35 Mon Sep 17 00:00:00 2001 From: Vishnu Mohandas Date: Mon, 15 Jun 2020 06:23:12 +0530 Subject: [PATCH] Update the tag used for heroes --- lib/ui/gallery.dart | 5 ++++- lib/ui/zoomable_image.dart | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/ui/gallery.dart b/lib/ui/gallery.dart index dc39a48197..e3fa8f01bd 100644 --- a/lib/ui/gallery.dart +++ b/lib/ui/gallery.dart @@ -130,7 +130,10 @@ class _GalleryState extends State { Widget _buildPhoto(BuildContext context, Photo photo) { Widget thumbnail; if (_openedPhoto == null || _openedPhoto == photo) { - thumbnail = Hero(tag: photo.hashCode, child: ThumbnailWidget(photo)); + thumbnail = Hero( + tag: photo.generatedId.toString(), + child: ThumbnailWidget(photo), + ); } else { thumbnail = ThumbnailWidget(photo); } diff --git a/lib/ui/zoomable_image.dart b/lib/ui/zoomable_image.dart index 1ca5ecc497..6d3ed9f91c 100644 --- a/lib/ui/zoomable_image.dart +++ b/lib/ui/zoomable_image.dart @@ -100,8 +100,8 @@ class _ZoomableImageState extends State minScale: PhotoViewComputedScale.contained, gaplessPlayback: true, heroAttributes: PhotoViewHeroAttributes( - tag: widget.photo.localId ?? - "uploaded_" + widget.photo.uploadedFileId.toString()), + tag: widget.photo.generatedId.toString(), + ), ); } else { return loadWidget;