正如我在标题中提到的,我尝试了很多方法来使用 CupertinoSliverRefreshControl 与超级支架一起工作,但从未成功。
body: CustomScrollView(
slivers: [
CupertinoSliverRefreshControl(
onRefresh: () {
print("refreshing ...");
return ref.refresh(skillsProvider.future);
},
// child: EasyRefresh(
// child: myPagedListView(ref),
// ),
),
SliverFillRemaining(
child: myPagedListView(ref),
)
],
),
要解决这个问题,请给我一个有效的例子
尝试添加
physics
body: CustomScrollView(
physics: const BouncingScrollPhysics(
parent: AlwaysScrollableScrollPhysics(),
),
slivers: [
CupertinoSliverRefreshControl(
onRefresh: () async {
print("refreshing ...");
await Future.delayed(Duration(seconds: 2)); //your future should be have some delay
return Future.value();
},
),
],
),
);