您可以将listview
放入具有特定SizedBox
的height
小部件中,然后您应该配置列表以使其以水平方式滚动:
SizedBox(
width: MediaQuery.of(context).size.width // This will make your list fill the screen horizontally
height: 100.0 // you can edit it as you desire but it should be small to make the effect of scroll-able row
child: listview.builder(
scrollDirection: Axis.horizontal, //This will make your list scroll on the horizontal axis
itemCount: 10.0,
itemBuilder: (BuildContext content, int index) {
// Your itemBuilder code here
}
),
),