轮播图部分,Swiper组件本身就有onTap方法,无需在
来源:12-16 加载进度条与下拉刷新的实现【实战应用】
ReggieMao
2019-04-01
轮播图部分,Swiper组件本身就有onTap方法,无需在Image组件外放一层GestureDetector
写回答
2回答
-
不悔有你ii
2019-04-23
Widget get _banner { return Container( height: 160, child: Swiper( autoplay: true, loop: true, pagination: SwiperPagination(), itemCount: bannerList.length, itemBuilder: (BuildContext context, int index) { return Image.network( bannerList[index].icon, fit: BoxFit.fill, ); }, onTap: (index) { print(index); Navigator.push( context, MaterialPageRoute( builder: (context) => WebView( url: bannerList[index].url, hideAppBar: bannerList[index].hideAppBar, title: bannerList[index].title, ))); }, ), ); }
00 -
CrazyCodeBoy
2019-04-01
能够举一反三,老师为你点赞
00
相似问题