我正在尝试在
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppBar(
backgroundColor: Colors.white,
title: Row(
mainAxisAlignment: MainAxisAlignment.end,
),
),
body: Column(
children: [
Row(
children: [
Text("Header")
],
),
ListView.builder(
shrinkWrap: true,
itemCount: verses.length,
itemBuilder: (context, i) {
return ListTile(
title: Text(verses[i].verseText),
);
},
)
],
),
));
}
但这会引发以下错误,
The following assertion was thrown during layout: A RenderFlex overflowed by 1917 pixels on the bottom.
我想念什么?
最佳答案
尝试用Expanded包装listView,如下所示:
Expanded (
child: ListView.buider(...)
)
关于flutter - 在 ListView 和AppBar之间添加一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61351727/