본문 바로가기
개발/플러터

[플러터] GridView 에 대해서

by 핸디(Handy) 2020. 5. 1.

GridView 란 열 수를 지정하여 그리드 형태로 표시하는 위젯입니다.

왼쪽부터  열수가 1부터 4까지 gridview의 모습

GridView.count(crossAxisCount: 4,
       children: <Widget>[
         Container(
           color: Colors.blue,
           width: 100,
           height: 100,
         ),
         Container(
           color: Colors.red,
           width: 100,
           height: 100,
         ),
         Container(
           color: Colors.green,
           width: 100,
           height: 100,
         )
       ],
       )

crossAxisCount : gridview 의 열(column) 개수입니다.

댓글