본문 바로가기

CS/Flutter | Dart

GridView

GridView

 

1. 한 번에 다 그림

퍼포먼스 상 효율적이진 않은듯

crossAxisSpacing: 16.0,

좌우 공백

mainAxisSpacing: 30.0,

위 아래 공백

 

 

 

2. 보이는 것만 그림

SliverGridDelegateWithFixedCrossAxisCount class

교차 축에 고정된 타일 수 사용해 그리드 레이아웃 만든다

그리드가 수직인 경우 이 대리자는 고정된 수의 열이 있는 레이아웃 만든다

그리드가 수평인 경우 이 대리자는 고정된 수의 행이 있는 레이아웃 만든다

이 대리자는 동일한 크기와 간격의 타일로 그리드 만든다

 

 

 

3. 최대 사이즈

SliverGridDelegateWithMaxCrossAxisExtent class

각각 최대 교차축 범위를 갖는 타일로 그리드 레이아웃 만든다

이 대리인은 다음 조건에 따라 가능한 한 큰 타일의 교차 축 범위를 선택한다

- 범위는 그리드의 교차축 범위를 균등하게 나눈다

- 범위는 최대 maxCrossAxisExtent 이다

 

 

 

https://api.flutter.dev/flutter/widgets/GridView-class.html

 

GridView class - widgets library - Dart API

A scrollable, 2D array of widgets. The main axis direction of a grid is the direction in which it scrolls (the scrollDirection). The most commonly used grid layouts are GridView.count, which creates a layout with a fixed number of tiles in the cross axis,

api.flutter.dev

 

 

 

'CS > Flutter | Dart' 카테고리의 다른 글

CustomScrollView - SliverList, SliverGrid  (9) 2023.08.27
ReorderableListView  (0) 2023.08.26
ListView  (0) 2023.08.24
SingleChildScrollView  (0) 2023.08.24
캘린더 일정관리 앱 #8  (0) 2023.08.23

Tiny Star