aagarwal1012 / Liquid-Pull-To-Refresh

🔁 A custom refresh indicator for flutter.

Home Page:https://pub.dev/packages/liquid_pull_to_refresh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[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.

2020-02-03 17 02 35

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.

  1. Copy this code to your build method - https://flutter-widget.live/widgets/NestedScrollView
  2. Wrap the inner ScrollView , in this case CustomScrollView with LiquidPullToRefresh

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)

nestedscroll_issue#40

I hope this helps.

Closing this issue since no further information is given.