horizontal_blocked_scroll_physics 1.1.1 copy "horizontal_blocked_scroll_physics: ^1.1.1" to clipboard
horizontal_blocked_scroll_physics: ^1.1.1 copied to clipboard

outdated

A ScrollPhysics class that blocks movement in the horizontal axis.

Horizontal Blocked ScrollPhysics #

Build Status License: MIT Pub

A ScrollPhysics class that blocks movement in the horizontal axis.

How to use it #

The API of this ScrollPhysics is fairly straighforward.

Basically, you have a couple of properties in order to block right (blockRightMovement) and left (blockLeftMovement) movements and another one, called allowRecovery, that will allow the scroll to recover its initial position in case the movement has not allowed the viewport to scroll to the next view.

Blocking movement with allowRecovery #

// allowRecovery is true by default
HorizontalBlockedScrollPhysics(blockLeftMovement: true);

You can see here that the user is swiping to the left (which is blocked) but the screen will be able to move to the left if the movement is not completed. Note that the text will go back to the center.

swiping_left_recovery

Blocking movement without allowRecovery #

HorizontalBlockedScrollPhysics(blockLeftMovement: true, allowRecovery: false);

This case is similar to the previous one except that this time the screen won't return to the center position as all the left movement is always blocked.

swiping_left_no_recovery

28
likes
0
pub points
88%
popularity

Publisher

verified publisherkoahealth.tech

A ScrollPhysics class that blocks movement in the horizontal axis.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on horizontal_blocked_scroll_physics