问题描述
我正在使用flutter_swiper库,并试图拥有可滑动的容器。我的问题是我必须在刷卡器的容器上设置一个确定的高度:
@override
Widget build(BuildContext context) {
DotsDecorator decorator = DotsDecorator(
activeColor: Theme.of(context).primaryColor.withOpacity(0.5),color: Colors.grey.withOpacity(0.3),activeSize: Size.square(10.0),activeShape: CircleBorder(),);
return Container(
height: // irritating definite height needed
child: Swiper(
itemBuilder: (BuildContext context,int index) {
return SummaryCard();
},itemCount: 2,itemWidth: 300.0,loop: false,viewportFraction: 0.9,pagination: SwiperPagination(),scale: 0.9),);
}
}
如果我在容器上设置了一定的高度,则摘要卡的内容有时会太小(尤其是在很小的屏幕上)。我希望容器能够动态调整,而不必设置确定的高度。
我是Flutter的新手,因此非常感谢您的帮助。在HTML / CSS中,这是微不足道的(在任何情况下div都可以适应),但是在这里我不知道该怎么做。
非常感谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)