akshathjain / sliding_up_panel

A draggable Flutter widget that makes implementing a SlidingUpPanel much easier!
https://pub.dartlang.org/packages/sliding_up_panel
Other
1.38k stars 378 forks source link

Swiping fast from fully open (max height) will skip the snap point #209

Open mikechoch opened 4 years ago

mikechoch commented 4 years ago

Describe the bug When swiping from open with a FAST velocity, the snap point is skipped and the panel is fully hidden. Now if I do a somewhat quick down to slow velocity it will go to snap point. However, I think there should be a setting to control stopping at snap point no matter what first.

To Reproduce

  1. Set a snap point on panel
  2. Swipe panel to max height or fully open
  3. Swipe very fast from open and the panel will skip the snap point and hide

Expected behavior The expected behavior is not like something is "broken". I think you there should be a mode or a setting to control swiping down to snap point FIRST and then you must swipe again to collapse or hide the panel.

Screen recording Example Video

Smartphone (please complete the following information):

Sample main.dart Please provide a sample main.dart that reproduces this issue. The code provided here should be able to be run on its own without any external dependencies.

SlidingUpPanel(
    controller: _swipePanelController,
    maxHeight: _swipePanelHeightOpen,
    snapPoint: _swipePanelSnapPoint,
    minHeight: _swipePanelHeightClosed,
    backdropTapClosesPanel: false,
    panelSnapping: true,
    borderRadius: BorderRadius.only(
        topLeft: Radius.circular(0.0),
        topRight: Radius.circular(0.0)),
    body: _body(),
    panelBuilder: (scrollController) => _panel(scrollController),
)
aluxen commented 2 years ago

Hi, same issue here, were you able to stop this behavior?

BenjiFarquhar commented 1 year ago

This is expected behaviour in the docs:

A fast swipe on the panel will disregard this point and go directly to the open/close position.

I'm finding it hard to swipe gently enough to hit the snap point, though. I hope it's easier on a physical device.