Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Swiping through gallery doesn't work sometimes #541

Open
ashilkn opened this issue Sep 22, 2023 · 5 comments
Open

[BUG] Swiping through gallery doesn't work sometimes #541

ashilkn opened this issue Sep 22, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@ashilkn
Copy link

ashilkn commented Sep 22, 2023

Describe the bug
When using photo_view to swipe through photos in a gallery, swiping (horizontal drag gesture) doesn't work sometimes. I enabled debugPrintGestureArenaDiagnostics and the logs gives an idea of what's happening internally.

When swiping works:

I/flutter (26426): Gesture arena 170  ❙ ★ Opening new gesture arena.
I/flutter (26426): Gesture arena 170  ❙ Adding: DoubleTapGestureRecognizer#b7996(debugOwner: PhotoViewGestureDetector)
I/flutter (26426): Gesture arena 170  ❙ Adding: PhotoViewGestureRecognizer#36e70(debugOwner: PhotoViewGestureDetector)
I/flutter (26426): Gesture arena 170  ❙ Adding: HorizontalDragGestureRecognizer#3afc9(start behavior: start)
I/flutter (26426): Gesture arena 170  ❙ Closing with 3 members.
I/flutter (26426): Gesture arena 170  ❙ Accepting: HorizontalDragGestureRecognizer#3afc9(start behavior: start)
I/flutter (26426): Gesture arena 170  ❙ Self-declared winner: HorizontalDragGestureRecognizer#3afc9(start behavior: start)

When swiping doesn't work:

I/flutter (26426): Gesture arena 169  ❙ ★ Opening new gesture arena.
I/flutter (26426): Gesture arena 169  ❙ Adding: DoubleTapGestureRecognizer#b7996(debugOwner: PhotoViewGestureDetector)
I/flutter (26426): Gesture arena 169  ❙ Adding: PhotoViewGestureRecognizer#36e70(debugOwner: PhotoViewGestureDetector)
I/flutter (26426): Gesture arena 169  ❙ Adding: HorizontalDragGestureRecognizer#3afc9(start behavior: start)
I/flutter (26426): Gesture arena 169  ❙ Closing with 3 members.
I/flutter (26426): Gesture arena 169  ❙ Accepting: PhotoViewGestureRecognizer#36e70(debugOwner: PhotoViewGestureDetector)
I/flutter (26426): Gesture arena 169  ❙ Self-declared winner: PhotoViewGestureRecognizer#36e70(debugOwner: PhotoViewGestureDetector)

So at times PhotoViewGestureRecognizer wins instead of HorizontalDragGestureRecognizer which is causing this issue.

To Reproduce
Use the example app (https://github.com/bluefireteam/photo_view/releases/tag/0.14.0) and go to "gallery". Open the first photo from the gallery and swipe to the next photo. The first swipe doesn't work, the second does. The bug comes up randomly too while swiping through photos.

What is the current behaviour?
Swiping (horizontal drag gesture) doesn't work sometimes.

Expected behaviour
Swiping will always work and shows next/prev photo.

Screenshots
https://github.com/bluefireteam/photo_view/assets/77285023/e8001129-3cd6-4399-a331-5103841b58bb

Which versions of Flutter/Photo View, and which browser / OS are affected by this issue? Did this work in previous versions of Photo View?
Flutter v3.10.6
photo_view v0.14.0
Reproducible on both Android and iOS.

@ashilkn ashilkn added the bug Something isn't working label Sep 22, 2023
@Julianojc
Copy link

Same error here, any solution?

@sirk390
Copy link

sirk390 commented Feb 3, 2024

Same issue. Every first swipe it doesn't work:

I/flutter (26851): Gesture arena 581 ❙ ★ Opening new gesture arena.
I/flutter (26851): Gesture arena 581 ❙ Adding: DoubleTapGestureRecognizer#2dfb4(debugOwner: PhotoViewGestureDetector)
I/flutter (26851): Gesture arena 581 ❙ Adding: PhotoViewGestureRecognizer#7fa14(debugOwner: PhotoViewGestureDetector)
I/flutter (26851): Gesture arena 581 ❙ Adding: HorizontalDragGestureRecognizer#d9dac(start behavior: start)
I/flutter (26851): Gesture arena 581 ❙ Closing with 3 members.
I/flutter (26851): Gesture arena 581 ❙ Accepting: PhotoViewGestureRecognizer#7fa14(debugOwner: PhotoViewGestureDetector)
I/flutter (26851): Gesture arena 581 ❙ Self-declared winner: PhotoViewGestureRecognizer#7fa14(debugOwner: PhotoViewGestureDetector)

Then on the second on it works:
I/flutter (26851): Gesture arena 582 ❙ ★ Opening new gesture arena.
I/flutter (26851): Gesture arena 582 ❙ Adding: DoubleTapGestureRecognizer#2dfb4(debugOwner: PhotoViewGestureDetector)
I/flutter (26851): Gesture arena 582 ❙ Adding: PhotoViewGestureRecognizer#7fa14(debugOwner: PhotoViewGestureDetector)
I/flutter (26851): Gesture arena 582 ❙ Adding: HorizontalDragGestureRecognizer#d9dac(start behavior: start)
I/flutter (26851): Gesture arena 582 ❙ Closing with 3 members.
I/flutter (26851): Gesture arena 582 ❙ Accepting: HorizontalDragGestureRecognizer#d9dac(start behavior: start)
I/flutter (26851): Gesture arena 582 ❙ Self-declared winner: HorizontalDragGestureRecognizer#d9dac(start behavior: start)
[GETX] CLOSE TO ROUTE /MyPhotoViewGallery

@alh67
Copy link

alh67 commented Mar 24, 2024

Is there a workaround ?

@Hilbert2048
Copy link

same issue

@sirk390
Copy link

sirk390 commented Apr 7, 2024

I think it's related to "android gesture navigation" because when this is disabled it works without issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants