我正在尝试制作一个屏幕,屏幕上有两列内容,分别是目标和距离;行程持续时间,我可以列出目标列表,但第二个列表中,带有距离和持续时间的列表没有显示,我通过在调试中打印检查了列表变量,它有元素,但列表视图没有打印,有人能帮我吗?以下是我尝试显示它时显示的内容,
下面是我用来制作列表的代码片段,
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text('Information'),), body: Column( children: [Row(children: [ IconButton(onPressed: (){test();}, icon: Icon(Icons.settings)), Expanded( child: Column( children: [ Title(color: Colors.white, child: Text('Goal')), ListView.builder( shrinkWrap: true, itemCount: transferDropoff.length, itemBuilder: (Context, Index){ return Container( height: 30, color: Colors.blue, child: Text(transferDropoff[Index],textAlign: TextAlign.center,style: TextStyle(color: Colors.white),), ); }, ), ], ), ), Expanded( child: Column( children: [ // Title(color: Colors.white, child: Text('Distance')), ListView.builder( shrinkWrap: true, itemCount: newConverted.length, itemBuilder: (Context, Index){ return Container( height: 30, color: Colors.blue, child: Text(newConverted[Index],textAlign: TextAlign.center,style: TextStyle(color: Colors.white),), ); }, ), ], ), )],), ],) ); }
仅供参考,这是从第一页成功传输所有数据的第二个屏幕。