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

Using Control inside of GestureDetector #24

Open
mcgaryp opened this issue Jun 4, 2020 · 2 comments
Open

Using Control inside of GestureDetector #24

mcgaryp opened this issue Jun 4, 2020 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@mcgaryp
Copy link

mcgaryp commented Jun 4, 2020

I'v noticed that when using this widget inside of an other gesture detector the Gesture Manager Arena will choose the Horizontal or Vertical Gesture before the Pan gesture of the Joystick.

I did some digging, looks like a possible solution is to Build a CustomPanGestureRecognizer within a RawGestureDetector. I tried implementing this but was unsuccessful due to my lack of understanding off GestureDetection in flutter. Here is a starting point that might help you. I'd be very interested in seeing this through as it relies on a rather large project I am building.

The Joy Stick View is within a multipage application and I use Flutter Swiper to navigate between pages.

You can see from the log that the Pan is winner when the gesture is a Verical Direction, but when it is in a Horizontal Direction the Pan does not win.

Here is a log of the Arena Manager
I/flutter (24667): Gesture arena 1271 ❙ ★ Opening new gesture arena. I/flutter (24667): Gesture arena 1271 ❙ Adding: PanGestureRecognizer#d3ee9(debugOwner: GestureDetector, start behavior: start) I/flutter (24667): Gesture arena 1271 ❙ Adding: HorizontalDragGestureRecognizer#1757e(start behavior: start) I/flutter (24667): Gesture arena 1271 ❙ Adding: TapGestureRecognizer#9cb38(debugOwner: GestureDetector, state: ready, button: 1) I/flutter (24667): Gesture arena 1271 ❙ Closing with 3 members. I/flutter (24667): Gesture arena 1271 ❙ Rejecting: TapGestureRecognizer#9cb38(debugOwner: GestureDetector, state: possible, button: 1) I/flutter (24667): Gesture arena 1271 ❙ Accepting: PanGestureRecognizer#d3ee9(debugOwner: GestureDetector, start behavior: start) I/flutter (24667): Gesture arena 1271 ❙ Self-declared winner: PanGestureRecognizer#d3ee9(debugOwner: GestureDetector, start behavior: start) D/ViewRootImpl@a3d787b[MainActivity](24667): ViewPostIme pointer 1 D/ViewRootImpl@a3d787b[MainActivity](24667): ViewPostIme pointer 0 I/flutter (24667): Gesture arena 1272 ❙ ★ Opening new gesture arena. I/flutter (24667): Gesture arena 1272 ❙ Adding: PanGestureRecognizer#d3ee9(debugOwner: GestureDetector, start behavior: start) I/flutter (24667): Gesture arena 1272 ❙ Adding: HorizontalDragGestureRecognizer#1757e(start behavior: start) I/flutter (24667): Gesture arena 1272 ❙ Adding: TapGestureRecognizer#9cb38(debugOwner: GestureDetector, state: ready, button: 1) I/flutter (24667): Gesture arena 1272 ❙ Closing with 3 members. I/flutter (24667): Gesture arena 1272 ❙ Rejecting: TapGestureRecognizer#9cb38(debugOwner: GestureDetector, state: possible, button: 1, sent tap down) I/flutter (24667): Gesture arena 1272 ❙ Accepting: HorizontalDragGestureRecognizer#1757e(start behavior: start) I/flutter (24667): Gesture arena 1272 ❙ Self-declared winner: HorizontalDragGestureRecognizer#1757e(start behavior: start)

@artur-ios-dev
Copy link
Owner

Hello, could you create a sample project where I can reproduce the issue?

Thanks

@mcgaryp
Copy link
Author

mcgaryp commented Jun 4, 2020

I would believe that this could also happen with a list view or some other scrolling view as they also contain drag gestures

example.txt

@artur-ios-dev artur-ios-dev added bug Something isn't working help wanted Extra attention is needed labels Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants