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 dragging programatically #28

Open
simplenotezy opened this issue May 8, 2023 · 1 comment
Open

Prevent dragging programatically #28

simplenotezy opened this issue May 8, 2023 · 1 comment

Comments

@simplenotezy
Copy link

It would be cool with a way to programatically set whether or not dragging was disabled, e.g. adding the option to pass an async callback function that determines whether or not dragging is disabled, or by adding some kind of controller.

The reason is with only having it as a property is it will cause all childs to re-render.

We have a scenario where when keyboard is visible we want to disable dragging, and when we do this, a re-render is triggered causing the keyboard (for some reason) to loose it's focus

@brvm
Copy link

brvm commented May 10, 2023

@simplenotezy why don't you wrap the DismissiblePage in a StreamBuilder and alter the DismissiblePageDismissDirection to be none when the keyboard is visible?

Using a StreamBuilder you can alter the DismissiblePageDismissDirection without all the children being rerendered.

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

2 participants