![](/img/trans.png)
[英]How can someone create a horizontal scroll list with snapping effect to the center
[英]How can i create horizontal scroll card in flutter
您可以尝试使用banner_carousel 。 我认为它最适合您的需要。 尝试使用customizedBanner
属性来获取轮播幻灯片的卡片:
BannerCarousel(
animation: false,
viewportFraction: 0.60,
showIndicator: false,
customizedBanners: [
Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.black,width: 2),),
child: Image.network(BannerImages.banner1)),
Container(
margin: EdgeInsets.symmetric(horizontal: 20),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.25),
spreadRadius: 0,
blurRadius: 4,
offset: Offset(0, 3),
),
],
),
child: Image.network(BannerImages.banner2)),
Container(
margin: EdgeInsets.symmetric(horizontal: 20),
decoration: BoxDecoration(
border: Border.all(
color: Colors.green,
width: 3,
),
borderRadius: BorderRadius.circular(50),
image: DecorationImage(
image: NetworkImage(
'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg'),
fit: BoxFit.cover,
),
),
),
],
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.