import 'package:flutter/material.dart'; import 'package:flutter_note/routers/application.dart'; import 'package:flutter_note/model/home_page_model.dart'; import 'package:flutter_note/routers/routers.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; class BannerDiy extends StatelessWidget { final List bannerImages; BannerDiy({Key key, @required this.bannerImages}) : super(key: key); @override Widget build(BuildContext context) { return SliverToBoxAdapter( child: Container( height: 180.0, child: Swiper( itemCount: bannerImages.length, itemBuilder: (context, int index) => InkWell( child: Image.network('${bannerImages[index].image}', fit: BoxFit.fill), onTap: () => Application.router.navigateTo( context, Routers.generateDetailsRouterPath( bannerImages[index].goodsId)), ), pagination: SwiperPagination(), autoplay: true, ), ), ); } }