RefreshIndicator 不显示
来源:12-16 加载进度条与下拉刷新的实现【实战应用】
慕神8170126
2023-08-16
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xf2f2f2),
body: LoadingContainer(isLoading: _loading,
child: Stack(children: [
MediaQuery.removePadding(
removeTop: true,
context: context,
child: RefreshIndicator(
onRefresh: _handleRefresh,
child: NotificationListener(
onNotification: (scrollNotification) {
if (scrollNotification is ScrollUpdateNotification && scrollNotification.depth == 0) {
_onScroll(scrollNotification.metrics.pixels);
}
return true;
},
child: ListView(
children: [
Container(
height: 160,
child: Swiper(
itemCount: _imageUrls.length,
autoplay: true,
itemBuilder: (BuildContext context, int index) {
return Image.network(_imageUrls[index], fit: BoxFit.fill,);
},
pagination: SwiperPagination()
),
),
Padding(
padding: EdgeInsets.fromLTRB(7, 4, 7, 4),
child: LocalNav(localNavList: localNavList)
),
if (gridNavModel != null)
Padding(
padding: EdgeInsets.fromLTRB(7, 0, 7, 4),
child: GridNav(gridNavModel: gridNavModel!),
),
Padding(
padding: EdgeInsets.fromLTRB(7, 0, 7, 4),
child: SubNav(subNavList: subNavList)
),
if (salesBox != null)
Padding(
padding: EdgeInsets.fromLTRB(7, 0, 7, 4),
child: SalesBox(salesBox: salesBox!),
),
],
),
),),
),
Opacity(
opacity: appBarAlpha,
child: Container(
height: 80,
decoration: BoxDecoration(color: Colors.white),
child: Center(
child: Padding(
padding: EdgeInsets.only(top: 20),
child: Text('首页'),
),
),
),
)
],),),
);
}
写回答
1回答
-
CrazyCodeBoy
2023-08-16
安卓还是iOS是下拉不显示吗?022023-08-18
相似问题