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