mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-02-15 04:39:23 +00:00
fix(mobile): improve hero animation (#3636)
This commit is contained in:
@@ -25,7 +25,7 @@ typedef PhotoViewGalleryPageChangedCallback = void Function(int index);
|
||||
|
||||
/// A type definition for a [Function] that defines a page in [PhotoViewGallery.build]
|
||||
typedef PhotoViewGalleryBuilder = PhotoViewGalleryPageOptions Function(
|
||||
BuildContext context,
|
||||
BuildContext context,
|
||||
int index,
|
||||
);
|
||||
|
||||
@@ -276,6 +276,7 @@ class _PhotoViewGalleryState extends State<PhotoViewGallery> {
|
||||
filterQuality: pageOption.filterQuality,
|
||||
basePosition: pageOption.basePosition,
|
||||
disableGestures: pageOption.disableGestures,
|
||||
heroAttributes: pageOption.heroAttributes,
|
||||
child: pageOption.child,
|
||||
)
|
||||
: PhotoView(
|
||||
@@ -306,21 +307,9 @@ class _PhotoViewGalleryState extends State<PhotoViewGallery> {
|
||||
basePosition: pageOption.basePosition,
|
||||
disableGestures: pageOption.disableGestures,
|
||||
errorBuilder: pageOption.errorBuilder,
|
||||
heroAttributes: pageOption.heroAttributes,
|
||||
);
|
||||
|
||||
if (pageOption.heroAttributes != null) {
|
||||
return Hero(
|
||||
tag: pageOption.heroAttributes!.tag,
|
||||
createRectTween: pageOption.heroAttributes!.createRectTween,
|
||||
flightShuttleBuilder: pageOption.heroAttributes!.flightShuttleBuilder,
|
||||
placeholderBuilder: pageOption.heroAttributes!.placeholderBuilder,
|
||||
transitionOnUserGestures: pageOption.heroAttributes!.transitionOnUserGestures,
|
||||
child: ClipRect(
|
||||
child: photoView,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ClipRect(
|
||||
child: photoView,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user