以下代码对我来说在调用和显示来自Firestore的数据方面运行良好:
以下代码对我来说在调用和显示来自Firestore的数据方面运行良好:
return ListView(
padding: const EdgeInsets.only(top: 20.0),
children: snapshot.map((data) => _buildListItem(context, data)).toList(),
);
但如果我尝试将它放在一列中,所以我在它上面添加另一个小部件,它会失败并显示堆栈溢出
:
return Column(
children: <Widget>[
Text('Hellow'),
ListView(
padding: const EdgeInsets.only(top: 20.0),
children: snapshot.map((data) => _buildListItem(context, data)).toList(),
)]);
ListView
中添加 -shrinkWrap: true,
- anmol.majhail