[Flutter] CustomSingleChildLayout ์ ๋ฆฌ
ยท
๐ง flutter
CustomSingleChildLayout childe์ ๋ ์ด์์์ ์ง์ ํ๋ ์์ ฏ์ด๋ค. delegate์ child ๋ ์ด์์์ constraints๋ฅผ ๊ฒฐ์ ํ ์ ์๋ค. ๋ํ child๋ฅผ ์ด๋์ ๋์ง, parent์ ํฌ๊ธฐ๋ฅผ ๊ฒฐ์ ํ๋ค. ํ์ง๋ง parent๋ child์ ํฌ๊ธฐ์ ์์กดํ์ง ์๋๋ค. CustomSingleChildLayout์ delegate๋ฅผ ์ง์ ํด์ผ ํ๋ค. ์ฃผ๋ก grid๋ฅผ ๋ง๋ค ๋ ์ฐ์ธ๋ค. ์ ๋ฆฌํ๋ฉด, child์ ์์น, ํฌ๊ธฐ๋ฅผ ๊ฒฐ์ ํ ๋ ์ฌ์ฉํ๋ layout ์ค ํ๋์ด๋ค. example 1) const CustomSingleChildLayout({ Key key, @required this.delegate, Widget child, }) example 2) Widget single(){ ret..