feat(mobile): stop asset grid rebuilds (#3226)

* feat(mobile): stop asset grid rebuilds

* undo unnecessary changes

---------

Co-authored-by: Fynn Petersen-Frey <zoodyy@users.noreply.github.com>
This commit is contained in:
Fynn Petersen-Frey 2023-07-13 17:42:06 +02:00 committed by GitHub
parent 863e983726
commit f9739c9730
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 80 additions and 113 deletions

View file

@ -37,12 +37,14 @@ class GalleryViewerPage extends HookConsumerWidget {
final Asset Function(int index) loadAsset;
final int totalAssets;
final int initialIndex;
final int heroOffset;
GalleryViewerPage({
super.key,
required this.initialIndex,
required this.loadAsset,
required this.totalAssets,
this.heroOffset = 0,
}) : controller = PageController(initialPage: initialIndex);
final PageController controller;
@ -589,7 +591,7 @@ class GalleryViewerPage extends HookConsumerWidget {
},
imageProvider: provider,
heroAttributes: PhotoViewHeroAttributes(
tag: asset.id,
tag: asset.id + heroOffset,
),
filterQuality: FilterQuality.high,
tightMode: true,
@ -606,7 +608,7 @@ class GalleryViewerPage extends HookConsumerWidget {
onDragUpdate: (_, details, __) =>
handleSwipeUpDown(details),
heroAttributes: PhotoViewHeroAttributes(
tag: asset.id,
tag: asset.id + heroOffset,
),
filterQuality: FilterQuality.high,
maxScale: 1.0,