[英]How do i put a Listview.builder in a column so i can put another widget on top of it?
您可以使用以下內容:
YourSearchBar(),
Expanded(
child: ListView()
)
您可以簡單地將列表視圖包裝在單子滾動視圖中的列和列中,並將列表視圖的物理設置為 NeverScrollableScrollPhysics。
代碼:-
SingleChildScrollView(
child: Column(
children: <Widget>[
YourSearchBar(),
Text('your text'),
ListView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount:10,//replace 10 with the count of elements in list
itemBuilder: (context,index){
return yourWidget();//return here the widget you want to show(your cake design one)
})
],
),
),
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.