Flutter_dismissible_page icon indicating copy to clipboard operation
Flutter_dismissible_page copied to clipboard

Prevent dragging programatically

Open simplenotezy opened this issue 1 year ago • 1 comments

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

simplenotezy avatar May 08 '23 18:05 simplenotezy

@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.

brvm avatar May 10 '23 14:05 brvm