
nested_scroll_view_plus
An enhanced NestedScrollView with support for overscrolling for both the inner and outer scrollviews.
🔥 Preview
Try it online: https://flutter-nested-scroll-view-plus.vercel.app
đź’ˇ Usage
Installation:
flutter pub add nested_scroll_view_plus
Example usage:
- Wrap your
SliverAppBar
withOverlapAbsorberPlus
- Use
OverlapInjectorPlus
on top of your innerCustomScrollView
- Change the physics of
CustomScrollView
toAlwaysScrollableScrollPhysics
That’s it!
For additional examples, please visit the scroll_master repository. It includes features such as pull-to-refresh for NestedScrollView
, combined scrolling for scrollview and tabview, and more.
đź“’ Others
⚙️ Accessing the Inner or Outer Scroll Controller
To access the inner or outer scroll controller of a NestedScrollViewPlus
, you can use a GlobalKey<NestedScrollViewStatePlus>
to get its state.
đźš© Preserve Scroll Positions of Inner CustomScrollViews
To preserve the scroll positions of inner CustomScrollViews
, you can add a PageStorageKey
to the CustomScrollView
widget. Here’s an example:
By assigning a unique key to the CustomScrollView
, Flutter’s PageStorage
mechanism will store and restore the scroll position of the inner CustomScrollViews
, allowing you to maintain the scroll positions even when the widget tree is rebuilt.
â•ď¸Ź For Older Flutter Versions
If you are using an older version of Flutter, please follow these steps to install the appropriate branch from the old git repository.
dependencies:
custom_nested_scroll_view:
git:
url: https://github.com/idootop/custom_nested_scroll_view.git
# Choose the branch based on your local Flutter version
ref: flutter-3.7
The different branches support the following Flutter versions:
Git branch | Supported flutter versions |
---|---|
flutter-3.7 | >=3.7.0-13.0.pre |
flutter-3.4 | >=3.4.0-27.0.pre <3.7.0-13.0.pre |
flutter-3.4-pre | >=3.4.0-17.0.pre <3.4.0-27.0.pre |
flutter-3.0 | >=2.12.0-4.0.pre <3.4.0-17.0.pre |
flutter-2.x | <2.12.0-4.0.pre |