flutter - RenderListWheelViewport 对象在布局期间被赋予无限大小
问题描述
我正在使用ListWheelScrollView
Widget 为我的列表项提供滚动效果,但出现上述错误。我只想在单个列表项中显示带有一些图像和文本的堆叠项,并为它们提供 3D Wheeling 效果。
下面是我的代码->
class ExploreWidget extends StatefulWidget {
@override
State<StatefulWidget> createState() => _ExploreState();
}
class _ExploreState extends State<ExploreWidget> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: null,
body: Column(
children: <Widget>[
_header(),
_exploreList()
],
)
);
}
Widget _header(){
return SizedBox(
height: 200,
width: 800,
);
}
Widget _exploreList(){
return ListWheelScrollView.useDelegate(
itemExtent: 75,
childDelegate: ListWheelChildBuilderDelegate(
builder:(context,index){
return Container(
height: 500,
width: 800,
child: Stack(
children: <Widget>[
Image(image: AssetImage(
_products[index].image
)),
Text(_products[index].name,style: Style.sectionTitleWhite,),
Text('70% off',style: Style.cardListTitleWhite,),
],
),
);
}
),
);
}
}
解决方案
推荐阅读
- kubernetes - 只运行一次 initContainer
- ruby-on-rails - Rails 什么时候应该使用强参数?
- python - @aws/cdk cfnfunction 上传代码python结构
- fortran - 如何在 Fortran 中以编程方式设置断点/在 Fortran 中引发 SIGINT
- azure-devops - 需要有关将机密更新到 KeyVault 的建议
- amazon-web-services - 使用 AWS SQS 的 spring-cloud-starter-aws maven 依赖项的替代方案
- kotlin - 对 Lambda 的反馈
- kubernetes - Kubectl 端口转发不适用于 IBM 集群
- javascript - 如何从 Firebase 存储中获取图像文件名?
- c# - 排除已经签到的学生 ID