在Flutter中垂直创建列表堆栈卡

问题描述 投票:0回答:1

我正在尝试使用Dart / Flutter小部件垂直滚动来创建列表自定义卡片:enter image description here创建堆栈视图后,我不知道为其垂直添加滚动:enter image description here请帮我。谢谢。

flutter flutter-layout
1个回答
0
投票
建议您使用flutter_swiper插件,而不是尝试自己构建这样的插件,>

Swiper( scrollDirection: Axis.vertical, itemBuilder: (BuildContext context, int index) { //here you can return your each widget based on index, all the scrolling, displaying stacked layout is handled by the plugin. return Image.network( "http://via.placeholder.com/288x188", fit: BoxFit.fill, ); }, itemCount: 10, itemWidth: 300.0, layout: SwiperLayout.STACK, )

© www.soinside.com 2019 - 2024. All rights reserved.