flutter_swiper
flutter_swiper copied to clipboard
【BUG】加载网络图片时,itemCount无法动态赋值,itemCount: bannerList.length,
@override Widget build(BuildContext context) { return Container( height: 132, // 轮播图插件 child: Swiper( itemCount: bannerList.length, autoplay: true, itemBuilder: (BuildContext context, int index) { if (bannerList.length == 0) { return null; } return Image.network( bannerList[index].icon, fit: BoxFit.cover, ); }, pagination: SwiperPagination( builder: DotSwiperPaginationBuilder(activeColor: Colors.red), ), // control: SwiperControl(), onTap: (int index) { print('点击了图片:' + index.toString()); }, ), ); }