Flutter中使用Banner 图

实现效果

"效果图"

首先导入flutter_swiper插件:

1
2
dependencies:
flutter_swiper: ^1.1.6

配置文件的链接地址

使用swiper插件

需要在使用的dart页面添加:

1
import 'package:flutter_swiper/flutter_swiper.dart';

然后才能在页面中使用轮播插件:

1
2
3
4
5
6
7
8
9
body:  new Swiper(
itemBuilder: (BuildContext context,int index){
return new Image.network("http://via.placeholder.com/350x150",fit: BoxFit.fill,);
},
itemCount: 3,
pagination: new SwiperPagination(),
control: new SwiperControl(),
),
);