Flutter - Layout a Grid

前端 未结 5 1065
隐瞒了意图╮
隐瞒了意图╮ 2020-11-29 01:46

I am trying to layout a 4x4 grid of tiles in flutter. I managed to do it with columns and rows. But now I found the GridView component. Could anyone provide an

5条回答
  •  迷失自我
    2020-11-29 02:18

    Please visit this repo.

    Widget _gridView() {
        return GridView.count(
          crossAxisCount: 4,
          padding: EdgeInsets.all(4.0),
          childAspectRatio: 8.0 / 9.0,
          children: itemList
              .map(
                (Item) => ItemList(item: Item),
              )
              .toList(),
        );
      }
    

    Below screenshot contains crossAxisCount: 2

提交回复
热议问题