zulip / zulip-flutter

Upcoming Zulip mobile apps for Android and iOS, using Flutter
Apache License 2.0
196 stars 191 forks source link

lightbox: Implement drag-to-dismiss #40

Open chrisbobbe opened 1 year ago

chrisbobbe commented 1 year ago

The lightbox has an "x" button in its app bar to close it, but it can't be closed with a drag gesture.

I think my ideal version of this would be: you drag or fling the image in any direction, then:

Maybe something like this is possible with the Draggable widget? (Probably it should only respond to drags this way if it's zoomed out all the way. If it's zoomed in, we want the InteractiveViewer to handle panning the image.)

Otherwise, maybe we can make the route dismissable with a drag-down gesture and no Hero animation. For this approach, we can look at the drag-gesture-based CupertinoRouteTransitionMixin, which deals with horizontal drag gestures, and maybe make something like that but for a downward drag gesture.

gnprice commented 1 year ago

See also