IntrinsicWidth class
๋ฐ๋ก ์ด์ ์ IntrinsicHeight class์ ๋ํด ๋ค๋ฃจ์๋ค.
height๊ฐ ์์ผ๋ width๋ ์กด์ฌํ๋ค.
IntrinsicHeight class์ ๊ฑฐ์ ๋น์ทํ ๋ด์ฉ์ด๋ค.
์ ์ค๋ช
์์ height๋ฅผ width๋ก ๋ฐ๊ฟ์ ์ดํดํ๋ฉด ๋๋ค.
์ด ์์ ฏ์ ๋๋น๊ฐ ์ ํ๋์ง ์๊ณ ๋ฌดํ ํ์ฅ์ ์๋ํ๋ child๋ฅผ ํ์๋ก ํ ๋ ์ ์ฉํ๋ค.
์ด ์์ ฏ์ด child์๊ฒ ์ ๋ฌํ๋ constraints๋ ๋ถ๋ชจ์ constraints๋ฅผ ์งํค๊ธฐ ๋๋ฌธ์ ๋ง์ฝ constraints๊ฐ child์ ์ต๋ ๊ณ ์ ๋์ด๋ฅผ ํฌํจํ ๋งํผ ์ถฉ๋ถํ ํฌ์ง ์์ผ๋ฉด ๋น๊ต์ ๋ฎ์ ๋์ด๋ฅผ ๊ฐ์ง๊ฒ ๋๋ค. ๋ฐ๋๋ก, ์ต์ ๋์ด constraints๊ฐ child์ ์ต๋ ๊ณ ์ ๋์ด๋ณด๋ค ํฌ๋ฉด ๋น๊ต์ ๋ ๋ง์ ๋์ด๊ฐ ์ง์ ๋๋ค.
- ๋ถ๋ชจ์ constraints < child์ ๊ณ ์ ๋๋น
๋ฎ์ ๋๋น๋ฅผ ๊ฐ์ง๊ฒ ๋๋ค. - ๋ถ๋ชจ์ constraints > child์ ๊ณ ์ ๋๋น
๋์ ๋๋น๋ฅผ ๊ฐ์ง๊ฒ ๋๋ค.
์ฆ, child๋ ๋ถ๋ชจ์ constraints๋ฅผ ๋ฐ๋ฅด๋๋ฐ, ์ด ๋ ๋ถ๋ชจ์ constraints์ child์ ๊ณ ์ ๋๋น ์ฌ์ด์ ๊ด๊ณ์ ๋ํ ๊ฒ์ด๋ค.
์ด class ๋ํ ๊ฐ๋ฅํ ์ฌ์ฉํ์ง ์๋ ๊ฒ์ ์ถ์ฒํ๋ค.
<์ฌ์ฉ ํ>
(์ฌ์ง์ถ์ฒ: https://bsscco.github.io/posts/flutter-layout-widgets/)
'๐ง flutter' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Flutter] Offstage class ์ ๋ฆฌ (0) | 2022.07.06 |
---|---|
[Flutter] LimitedBox class ์ ๋ฆฌ (0) | 2022.07.06 |
[Flutter] IntrinsicHeight class ์ ๋ฆฌ (0) | 2022.07.06 |
[Flutter] FractionallySizedBox class ์ ๋ฆฌ (0) | 2022.07.06 |
[Flutter] FittedBox Class ์ ๋ฆฌ (0) | 2022.07.06 |