Skip to content

Flutter scroll-physics which behaves like `BouncingScrollPhysics`, except doesn't let you to over-scroll on top.

License

Notifications You must be signed in to change notification settings

qyre-ab/flutter_top_blocked_bouncing_scroll_physics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter scroll-physics which behaves like BouncingScrollPhysics, except doesn't let you to over-scroll on top.

Usage

If you want over-scroll on bottom only when the content is longer than max scroll extent, use TopBlockedBouncingScrollPhysics:

return ListView(
  physics: const TopBlockedBouncingScrollPhysics(),
);

If you always want over-scroll on the bottom, use AlwaysScrollableScrollPhysics with TopBlockedBouncingScrollPhysics as a parent:

return ListView(
  physics: const AlwaysScrollableScrollPhysics(
    parent: TopBlockedBouncingScrollPhysics(),
  ),
);

Demo