flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
164.89k stars 27.16k forks source link

Programmatically trigger a CupertinoSliverRefreshControl refresh #31376

Open edwardez opened 5 years ago

edwardez commented 5 years ago

In RefreshIndicator we have RefreshIndicatorState.show() which let developers programmly trigger a refresh.

It would be nice if we can see something similiar in CupertinoSliverRefreshControl

shuicheng commented 5 years ago

RefreshIndicator支持取消刷新的操作, 希望CupertinoSliverRefreshControl也能支持取消刷新的功能

mrxten commented 3 years ago

Any news for that?

naamapps commented 3 years ago

You can attach a scroll controller to the scroll view and animate it to a negative number, this will trigger the refresh.

scrollController.animateTo(-70,
        duration: const Duration(milliseconds: 200), curve: Curves.ease);
flutter-triage-bot[bot] commented 6 months ago

This issue is missing a priority label. Please set a priority label when adding the triaged-design label.

HansMuller commented 6 months ago

CC @MitchellGoodwin

Ideally, the Material RefreshIndicator could adapt its look and feel for iOS and one API would suffice.

victorsanni commented 2 weeks ago

You can attach a scroll controller to the scroll view and animate it to a negative number, this will trigger the refresh.

RefreshIndicatorState.show() does something similar as well, manually triggering a refresh.

@edwardez thinking about this issue with @MitchellGoodwin, since the CupertinoSliverRefreshControl is in the scroll view, how is it supposed to react if the scrollable content is not scrolled to the top (i.e if it's halfway down or more)? If a refresh is triggered manually, does the scroll view scroll to the top, then show the overscroll area and the spinner? Or just show the area and spinner with no scroll?