[Feature Request] Add support for NestedScrollViews
ThinkDigitalSoftware opened this issue · comments
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
I'm trying to add a pull to refresh with a NestedScrollView
, but this widget doesn't extend ScrollView, so it doesn't work
Describe the solution you'd like
A clear and concise description of what you want to happen.
A widget that works with NestedScrollViews
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Hi @ThinkDigitalSoftware ! Thanks for suggesting this.
There are several open issues regarding NestedScrollView
and its use with RefreshIndicator
for example :-
flutter/flutter#34727 (comment)
flutter/flutter#17518 (comment)
You can also verify them yourself by wrapping the built in RefreshIndicator
around a NestedScrollView
. It does not work.
Our work around for this is relatively simple. Wrap your inner ScrollView
with the LiquidPullToRefresh
to make it work.
Here is how I made it work.
- Copy this code to your build method - https://flutter-widget.live/widgets/NestedScrollView
- Wrap the inner
ScrollView
, in this caseCustomScrollView
withLiquidPullToRefresh
This works because we already have the package built for cases of OverScrollNotification
for direct child widgets. When you apply it over the NestedScrollView
it somehow does not seem to handle the OverScrollNotification
in the way we expect. Since it is a prevailing issue there is not much to say about it.
You can refer to another example here - flutter/flutter#26409 (comment)
I hope this helps.
Closing this issue since no further information is given.