[flutter5] show context action

ํ•œ๋ณ„onestarยท2024๋…„ 4์›” 30์ผ

flutter ์‹ค์ „

๋ชฉ๋ก ๋ณด๊ธฐ
5/15
post-thumbnail

show context action

๐Ÿท๏ธ show context action (์ปจํ…์ŠคํŠธ ์•ก์…˜ ํ‘œ์‹œ)
์ž๋™์œผ๋กœ ์œ„์ ฏ์„ ๊ฐ์‹ธ ์ฃผ๊ฑฐ๋‚˜ ์ œ๊ฑฐํ•ด ์ค€๋‹ค.

๊ฐ์‹ธ๊ณ  ์‹ถ์€ ์œ„์ ฏ?์— ์˜ค๋ฅธ์ชฝ ๋งˆ์šฐ์Šค๋ฅผ ํด๋ฆญํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ์ฐฝ์ด ๋œฌ๋‹ค. ์—ฌ๊ธฐ์„œ ์ปจํ…์ŠคํŠธ ์•ก์…˜ ํ‘œ์‹œ๋ฅผ ํด๋ฆญํ•ด ์ค€๋‹ค.


์ด ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•ด Column์„ padding ์œ„์ ฏ์œผ๋กœ ๊ฐ์‹ธ๋ณธ๋‹ค. ํด๋ฆญํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ์ฐฝ์œผ๋กœ ๋ฐ”๋€Œ๊ณ  ์—ฌ๊ธฐ์„œ Wrap with Padding์„ ํด๋ฆญํ•ด ์ค€๋‹ค.


๊ทธ๋Ÿผ ์ €์ ˆ๋กœ Column์ด Padding์œผ๋กœ ๊ฐ์‹ธ์ง„๋‹ค ๐Ÿ‘

  • ์›๋ž˜ ์ฝ”๋“œ
body: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Image.asset('asset/img/logo.png'),
            SizedBox(height: 30), //๋กœ๊ณ  ์ด๋ฏธ์ง€์™€ ๋กœ๋”ฉ์จํด ์‚ฌ์ด์˜ ๊ฐ„๊ฒฉ์„ ๋ฒŒ๋ ค์ฃผ๋Š” ๋ฐ•์Šค
            CircularProgressIndicator(
              color: Colors.white,
            )
          ],
        ));

  • ์ˆ˜์ •๋œ ์ฝ”๋“œ
body: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Image.asset('asset/img/logo.png'),
              SizedBox(height: 30), //๋กœ๊ณ  ์ด๋ฏธ์ง€์™€ ๋กœ๋”ฉ์จํด ์‚ฌ์ด์˜ ๊ฐ„๊ฒฉ์„ ๋ฒŒ๋ ค์ฃผ๋Š” ๋ฐ•์Šค
              CircularProgressIndicator(
                color: Colors.white,
              )
            ],
          ),
        ));
profile
ํ•œ๋ณ„์ž‰

0๊ฐœ์˜ ๋Œ“๊ธ€