导入     flutter_swiper: ^1.1.6

引入     import 'package:flutter_screenutil/flutter_screenutil.dart';

已下是一个完整的swiper的代码

Container(
height: ,
child: Swiper(
itemCount: imagePaths.length,
itemHeight: ,
itemWidth: ,
autoplay: true, // 自动播放
layout: SwiperLayout.STACK, // 样式
pagination: SwiperPagination(),// 添加一个页码指示器
itemBuilder: (context, index) {
return Container(
color: Colors.grey,
child: Image.network(
imagePaths[index],
fit: BoxFit.cover,
),
);
},
),
)
final imagePaths = [
'http://pic1.win4000.com/wallpaper/c/53cdd1f7c1f21.jpg',
'http://pic25.nipic.com/20121112/9252150_150552938000_2.jpg',
'http://pic51.nipic.com/file/20141025/8649940_220505558734_2.jpg',
'http://gss0.baidu.com/-fo3dSag_xI4khGko9WTAnF6hhy/lvpics/w=600/sign=1350023d79899e51788e391472a5d990/b21bb051f819861810d03e4448ed2e738ad4e65f.jpg',
'http://a.hiphotos.baidu.com/lvpics/h=800/sign=5a82402cd5ca7bcb627bca2f8e086b3f/caef76094b36acaf0651ef137ed98d1000e99caf.jpg',
'http://pic39.nipic.com/20140320/12795880_110914420143_2.jpg',
'http://pic38.nipic.com/20140217/7643674_131828170000_2.jpg',
];

最新文章

  1. 《Effective java》-----读书笔记
  2. UML类图画法及其之间关系
  3. 转-利用Oracle审计功能来监测试环境的变化
  4. ucos
  5. Android 按键消息处理Android 按键消息处理
  6. Native App, Hybrid App, Web App对比
  7. 强大的游戏开发工具Unity3D推出2D开发工具,unity将混合3D与2D开发
  8. BZOJ 1269: [AHOI2006]文本编辑器editor( splay )
  9. Oracle SQL 内置函数大全
  10. 饥饿的牛(hunger)
  11. shell命令输入输出重定向
  12. Python面向对象编程 -- 类和实例、访问限制
  13. Java并发编程(五)-- Java内存模型补充
  14. redis.conf 配置信息:读取及修改命令
  15. 外网访问局域网ip的方法
  16. Hive官方使用手册——新Hive CLI(Beeline CLI)
  17. HTTP错误405
  18. 032:基于Consul和MGR的MySQL高可用架构
  19. range循环
  20. python 执行字符串中的python代码

热门文章

  1. C学习笔记-字符串处理函数
  2. vue60秒倒计时
  3. java知识随笔整理-Oracle存储过程优缺点
  4. Android UI组件:布局管理器
  5. git回退
  6. Codeforces 1178F2. Long Colorful Strip
  7. Eclipse怎么改变@author 姓名
  8. java——ArrayList中contains()方法中的疑问
  9. DispatcherTimer和Timer的区别
  10. redis的数据结构及操作命令