Container(
height: 200.0,
padding: EdgeInsets.symmetric(vertical: 20.0, horizontal: 10.0),
child: ListView.separated(
padding: EdgeInsets.only(right: 8.0),
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
FoodCate foodCate = snap.data[index];
return FoodKindButton(img: foodCate.img, title: foodCate.cate);
},
separatorBuilder: (context, index) {
return Container(
color: Colors.transparent,
width: 1.0,
);
},
itemCount: snap.data.length),
);
要綁定高度,避免出現 Horizontal viewport was given unbounded height. 訊息