animation - 卡片轮播刷卡,细节扑朔迷离
问题描述
我想创建一堆具有轮播效果的图像,图像的详细信息将在下面显示在不同的容器中。从堆栈中滑动图像时,图像的细节将随之改变。
已经完成了图像轮播部分和滑动。
CarouselSlider(
viewportFraction: 0.7,
aspectRatio: 1,
autoPlay: true,
enlargeCenterPage: true,
items: carouselList.map(
(image) {
return Container(
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10),
),
image:
DecorationImage(image: AssetImage(image), fit: BoxFit.cover),
),
);
},
).toList(),
);
从堆栈中滑动图像时如何更改图像的细节?想要实现如下图所示的滑块。
解决方案
您是否在可以创建自己的动态树的包中检查了这个:
CarouselSlider.builder(
itemCount: 15,
itemBuilder: (BuildContext context, int itemIndex) =>
Container(
child: Text(itemIndex.toString()),
),
)
您的 carouselList 将是您拥有标题、发布日期、评级和图像的类对象列表。将列表传递给构建器会将每个对象渲染到该长度。
推荐阅读
- apache-nifi - 在流期间执行一次 NIFI InvokeHTTP 处理器,而不是基于每个入站流文件
- c# - 为什么 trackbar 只能作为 ON 和 OFF 模式工作?
- java - Android,opencv - 尝试初始化 Mat 时未找到 long org.opencv.core.Mat.n_Mat() 的实现
- python - 如何从图像(png或jpg)获取文件名并将其更改为时间时间戳?
- entity-framework-core - Azure Function PostBuild 文件副本丢失
- ansible - Ansible - 从 dict 条目中读取子键并连接到字符串
- python - matplotlib 中的 plt.show() 不会打开窗口
- jmeter - 是否可以参数化 Post 请求有效负载,然后在 Jmeter 中将其编码为 base64
- javascript - 如何使按钮静态并固定在底部
- shell - Rundeck Webhook 将参数传递给 shell 脚本