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

Prevent vertical dragging when touching a specific child widget #305

Open
jpcarreira opened this issue May 30, 2022 · 7 comments
Open

Prevent vertical dragging when touching a specific child widget #305

jpcarreira opened this issue May 30, 2022 · 7 comments

Comments

@jpcarreira
Copy link

I've been using SlidingUpPanel for a while and, so far, whenever I had the need to stop the vertical drag I would just set the isDragable to false. However, now I have a use case where the panelBuilder builds a given widget that, amongst its children, has a ListView with horizontally-scrollable content and what I'm trying to achieve is preventing the sliding up panel moving up or down when I'm scrolling left or right through that list view.

Is there any easy way of achieving this? I've tried the obvious toggle of isDraggable when a couple of callbacks that detect that horizontal scroll are triggered but that doesn't work as the entire sliding_up_panel is rebuilt when setting isDragable. Also tried a CustomGestureRecognizer on that child widget to prevent vertical swipes of going up but had no success too. Any tips?

@nbonamy
Copy link

nbonamy commented Oct 29, 2022

+1

@jpcarreira
Copy link
Author

@nbonamy feel free to take a look at this fork, we've made it work for us.

@cer-cer
Copy link

cer-cer commented Feb 28, 2023

@jpcarreira can you explain how to implement it? i need embed a mapview in this controller, and need to zoom in/out which conflict with this controller...

@jpcarreira
Copy link
Author

@jpcarreira can you explain how to implement it? i need embed a mapview in this controller, and need to zoom in/out which conflict with this controller...

Please check the fork, the code I did change on that fork isn't a significant change. It's hard to recall exactly what I did, it's been a few months since I've implemented it.

@iosifnicolae2
Copy link

wouldn't be possible to have this fix backported to the main repo?

@iosifnicolae2
Copy link

@jpcarreira can you explain how to implement it? i need embed a mapview in this controller, and need to zoom in/out which conflict with this controller...

I'm using something like this:

SlidingUpPanel(
    ....
    gestureSlidingEnabled: gestureSlidingEnabled,
)
Listener(
    behavior: HitTestBehavior.translucent,
    onPointerDown: (PointerDownEvent details){
      developer.log("onPointerDown");
      gestureSlidingEnabled = false; // you might need to use setState..
    },
    onPointerUp: (PointerUpEvent details){
      developer.log("onPointerUp");
      gestureSlidingEnabled = true; // you might need to use setState..
    },
    child: Swiper(...)
)

@furkancetintass
Copy link

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants