aboutsummaryrefslogtreecommitdiff
path: root/lib/widgets/viewer/hero.dart
diff options
context:
space:
mode:
authormirror <mirror@localhost>2026-11-22 08:41:00 +0900
committermirror <mirror@localhost>2026-11-22 08:41:00 +0900
commit449d8b74bd6d9dae98a07254cdfad677b920e7b0 (patch)
treec131c3528c4d517f56e19b854a7453fedb097d40 /lib/widgets/viewer/hero.dart
downloadaves-src-master.tar.gz
aves-src-master.zip
snapshot of aves v1.13.12 (secrets removed: android/app/google-services.json)HEADv1.13.12master
Diffstat (limited to 'lib/widgets/viewer/hero.dart')
-rw-r--r--lib/widgets/viewer/hero.dart20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/widgets/viewer/hero.dart b/lib/widgets/viewer/hero.dart
new file mode 100644
index 0000000..d1432d3
--- /dev/null
+++ b/lib/widgets/viewer/hero.dart
@@ -0,0 +1,20 @@
+import 'package:aves/model/entry/entry.dart';
+import 'package:aves/model/source/collection_lens.dart';
+import 'package:equatable/equatable.dart';
+import 'package:flutter/widgets.dart';
+
+@immutable
+class EntryHeroInfo extends Equatable {
+ // hero tag should include a collection identifier, so that it animates
+ // between different views of the entry in the same collection (e.g. thumbnails <-> viewer)
+ // but not between different collection instances, even with the same attributes (e.g. reloading collection page via drawer)
+ final CollectionLens? collection;
+ final AvesEntry? entry;
+
+ @override
+ List<Object?> get props => [collection?.id, entry?.uri];
+
+ const EntryHeroInfo(this.collection, this.entry);
+
+ int get tag => Object.hashAll([collection?.id, entry?.uri]);
+}