fix(mobile): Disable hit testing for transparent bars (#2727)

This commit is contained in:
Sergey Kondrikov 2023-06-11 21:10:17 +03:00 committed by GitHub
parent 9a80a2151c
commit e101e40c47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -276,7 +276,9 @@ class GalleryViewerPage extends HookConsumerWidget {
(showAppBar.value && !isZoomed.value)) &&
!isPlayingVideo.value;
return AnimatedOpacity(
return IgnorePointer(
ignoring: !show,
child: AnimatedOpacity(
duration: const Duration(milliseconds: 100),
opacity: show ? 1.0 : 0.0,
child: Container(
@ -286,11 +288,13 @@ class GalleryViewerPage extends HookConsumerWidget {
asset: asset(),
isFavorite: asset().isFavorite,
onMoreInfoPressed: showInfo,
onFavorite: asset().isRemote ? () => toggleFavorite(asset()) : null,
onFavorite:
asset().isRemote ? () => toggleFavorite(asset()) : null,
onDownloadPressed: asset().isLocal
? null
: () =>
ref.watch(imageViewerStateProvider.notifier).downloadAsset(
: () => ref
.watch(imageViewerStateProvider.notifier)
.downloadAsset(
asset(),
context,
),
@ -300,6 +304,7 @@ class GalleryViewerPage extends HookConsumerWidget {
onAddToAlbumPressed: () => addToAlbum(asset()),
),
),
),
);
}
@ -307,7 +312,10 @@ class GalleryViewerPage extends HookConsumerWidget {
final show = (showAppBar.value || // onTap has the final say
(showAppBar.value && !isZoomed.value)) &&
!isPlayingVideo.value;
return AnimatedOpacity(
return IgnorePointer(
ignoring: !show,
child: AnimatedOpacity(
duration: const Duration(milliseconds: 100),
opacity: show ? 1.0 : 0.0,
child: BottomNavigationBar(
@ -355,6 +363,7 @@ class GalleryViewerPage extends HookConsumerWidget {
}
},
),
),
);
}