我正在嘗試更改容器的 with,我需要它在 listView 課程中我需要它是可滾動的。我究竟做錯了什么?這是代碼:
Widget build(BuildContext context) {
return Scaffold(
body: Container(
height: height,
width: width,
color: Color.fromRGBO(242, 228, 214, 1),
child: Expanded(
child: ListView(children: [
SizedBox(
height: 20,
),
Container(
height: 100,
width: 100,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 2,
blurRadius: 10,
offset: Offset(0, 3), // changes position of shadow
),
],
color: Color.fromRGBO(247, 241, 236, 1)),
],
),
),
]))));}}
奇怪的是,沒有 ListView 可以編輯容器。
uj5u.com熱心網友回復:
我們可以使用ListView' 填充來處理這種情況。
child: ListView(
padding: EdgeInsets.symmetric(vertical: width * .1),// or use EdgeInsets.only based on your need
children: [
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/431297.html
標籤:扑
