gpt4 book ai didi

flutter - 无法将列表嵌套在ExpansionTileCard中

转载 作者:行者123 更新时间:2023-12-03 04:35:11 24 4
gpt4 key购买 nike

我正在尝试将listview.builder嵌套在ExpansionTileCard中,但无法执行此操作,我收到此错误
错误

The following assertion was thrown during performResize():Vertical viewport was given unbounded height.


ExpansionTileCard(


leading: GestureDetector(
onTap: (){

var firstdata = jsonResponse['content'];

code = firstdata[index]['code'];
},
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Image.asset('images/appicon.png', width: 50, height: 50)),

),

title: GestureDetector(
onTap: (){

var firstdata = jsonResponse['content'];

code = firstdata[index]['code'];
name = firstdata[index]['name'];

Navigator.push(context, MaterialPageRoute(builder: (context) =>PageViewClass(companycode: code,userid: widget.userid,)));
},
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(firstdata[index]['name'] ?? 'NULL PASSED'),

],
),

),
children: <Widget>[
Divider(
thickness: 1.0,
height: 1.0,

),
Align(
alignment: Alignment.center,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8.0,
),

child:ListView.builder(
itemCount: list1.length,
itemBuilder: (BuildContext ctx, int index){

return Text(list1[index]['name']);



}
)

),
),
],
);
ExpansionTileCard已在父 Listview.builder中使用。
请指导我解决此问题

最佳答案

在Listview.builder中,您可以尝试保留shrinkWrap: true
在Column Widget中,您可以保留mainAxisSize = MainAxisSize.min
两者结合可以解决问题。

关于flutter - 无法将列表嵌套在ExpansionTileCard中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64276415/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com