Skip to content

Flutter custom ScrollPhysics for bottom sheets with nested scroll views.

License

Notifications You must be signed in to change notification settings

weakvar/bottom_sheet_scroll_physics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BottomSheetScrollPhysics

A custom scroll physics for modal bottom sheets with nested scroll view.

This BottomSheetScrollPhysics behaves as ClampingScrollPhysics at the top of the scroll and as the default ScrollPhysics on the bottom. This means that on iOS it will behave like ClampingScrollPhysics at the top and BouncingScrollPhysics at the bottom. And on Android, it will behave like ClampingScrollPhysics at the top and at the bottom of the scroll.

Examples

Default ScrollPhysics

Default ScrollPhysics

Bottom Sheet with BottomSheetScrollPhysics

Bottom Sheet with BottomSheetScrollPhysics

Usage

Use BottomSheetScrollPhysics as a physics widget in scrollable widgets.

@override
Widget build(BuildContext context) {
  return CustomScrollView(
    physics: const BottomSheetScrollPhysics(),
    slivers: [
      // ...
    ],
  );
}

Issues

To report your issues, submit them directly in the Issues section on GitHub.

About

Flutter custom ScrollPhysics for bottom sheets with nested scroll views.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published