snappingTriggerPercentage property

double snappingTriggerPercentage
final

If snapping is applied, you can also provide this value to control at which extent the snapping takes place.

When you provide this value, it will be used whether to snap the panel or not. Panel is snapped, if the speed of user's swiping is more than this much percentage of the device's screen height.

In other words, if user swipes the panel at such speed as if he swiped panel for 1 second, and if it would cover more than this much of percentage of screen height, snapping is applied.

This is useful, in cases like you don't want the panel to be snapped every time. If the user swipes panel at certain speed, then only snapping should take place.

You can provide any non-negative value, considered as 'percentage of the screen height'. e.g., If you provide 250.0, it will be considered as 250% of screen height. It is suggested to keep it between '80.0' to '200.0'.

If you provide this value, it will be clamped (adjusted) between '0.0 and 750.0' actual PIXELS of the screen. Since, going beyond has no actual usefulness.

Note that, even if keeping any value, if the user holds the panel for one second in idle state after swiping and then releases the finger, IT WILL NOT be snapped. This is kept in case the user forcefully wants the panel to be in the that position. To overcome this problem, set snapping to PanelSnapping.forced.

Default : 0.0

Implementation

final double snappingTriggerPercentage;