默认情况下,GridView将项目放置在行中,直到crossAxisCount达到
GridView.count(
crossAxisCount: 5,
mainAxisSpacing: 10,
crossAxisSpacing: 10,
padding: EdgeInsets.all(10.0),
children: hours
)
是否可以将构建方向从水平更改为垂直?
答案 0 :(得分:1)
更改滚动方向应该可以满足您的要求:
GridView.count(
crossAxisCount: 5,
mainAxisSpacing: 10,
scrollDirection: Axis.vertical,
crossAxisSpacing: 10,
padding: EdgeInsets.all(10.0),
children: hours
)