gpt4 book ai didi

flutter - 在 ListView 和AppBar之间添加一行

转载 作者:行者123 更新时间:2023-12-03 04:50:59 26 4
gpt4 key购买 nike

我正在尝试在

  @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/

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