问题描述
我在主屏幕上使用 bloc 方法。我想在主屏幕上拉动刷新... 我厌倦了太多的方法没有得到解决......你能提出一些解决方案吗。
在 onrefresh() 旁边,我添加了一些更改
1 . BlocProvider(
create: (context) => ottGetAllMovie(httpClient: http.Client())
..add(FeedsFetched(widget.title,"homePage")),//child: HomePage(),child: ottGetHomeInnerCatPage(
wtitle: widget.title,mixpanelinner: widget.mixpanel),)
2. _FeedsBloc.add(FeedsFetched(widget.wtitle,"homePage"));
3. setState(() {
_FeedsBloc.add(FeedsFetched(widget.wtitle,"homePage"));
BlocProvider(
create: (context) => ottGetAllMovie(httpClient: http.Client())
..add(FeedsFetched(widget.title,)
});
解决方法
虽然
这似乎是您用来获取数据的方法
OttGetAllMovie(httpClient: http.Client())
..add(FeedsFetched(widget.title,"homePage")),
将您的身体包裹在液体中以提神
LiquidPullToRefresh(
key: _refreshIndicatorKey,// key if you want to add
onRefresh: ()async{
//cal your data source
OttGetAllMovie(httpClient: http.Client())
..add(FeedsFetched(widget.title,}
child: ListView(),// scroll view
);