FittedBox

 

[Ko]

* FittedBox : 차일드 또는 내용물의 양에 따라 크기가 확장되는 위젯에 의해 오버플로우가 발생되는 경우 FittedBox로 감싸면 디바이스 사이즈를 넘지않게되며 오버플로우가 방지됨.

내용물이 가로 방향으로 확장되는 위젯(Text위젯)이라면, 그 부모가 컬럼인 경우에는 width는 기기 또는 부모 사이즈에 한정되므로 FittedBox로 감싸면 width에 맞춰 내용물이 줄어들지만, 부모가 로우인 경우는 로우는 가로 방향으로 무한대의 width를 허락하므로 FittedBox로 감싸도 아무 영향도 주지 않음.

로우를 핏티드박스로 감싸면 메인 엑시스인 가로 방향으로 축소시키고, 컬럼을 감싸면 세로 방향으로 축소시킴.

 

[En]

* FittedBox: If overflow occurs due to a widget that expands in size depending on the amount of child or contents, wrapping it with FittedBox will not exceed the device size and prevent overflow.
If the content is a widget that extends in the horizontal direction (Text widget), if the parent is a column, the width is limited to the device or parent size, so when wrapped with a FittedBox, the content is reduced to fit the width, but if the parent is low, the row is horizontal Allows an infinite width in the direction, so wrapping it with a FittedBox has no effect.
When wrapped in a fit box, the row is reduced in the horizontal direction, which is the main axis, and when wrapped in a column, it is reduced in the vertical direction.

'플러터(Flutter) > 플러터 위젯(Flutter Widget)' 카테고리의 다른 글

SingleChildScrollView  (0) 2020.03.19
Slider, Customizing Widgets with Themes  (0) 2020.03.19
FlatButton widget  (0) 2020.03.18
Expanded Widget to Create Flexible Layouts  (0) 2020.03.18
Card & ListTile Widget  (0) 2020.03.18

+ Recent posts