ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [Flutter] Row๋ณด๋‹จ OverflowBar ๐Ÿ‘
    ๊ฐœ๋ฐœ/Flutter๐Ÿ“ฑ 2023. 8. 17. 20:04

    https://rhimc.tistory.com/12

    ๐Ÿ‘†

    ์š”๊ณ  ๊ณต๋ถ€ ๋จธํ„ฐ๋ฆฌ์–ผ ๊ตฌ์„ฑ์š”์†Œ ๊ณต๋ถ€ํ•˜๋‹ค๊ฐ€ ์•Œ๊ฒŒ๋œ ์œ„์ ฏ! ใ…Ž

     

    ํ‰์†Œ์— ์˜†์œผ๋กœ ๋‚˜์—ดํ• ๋•Œ Row ์œ„์ ฏ์„ ๋งŽ์ด ์‚ฌ์šฉํ•˜๋Š”๋ฐ 

    OverflowBar ์š”๊ณ  ์•„์ฅฌ ๐Ÿ‘

     

    Row๋Š” ์‚ฌ์šฉํ•˜๋‹ค๋ณด๋ฉด ์ข…์ข… UI ์˜ค๋ฒ„ํ”Œ๋กœ์šฐ๊ฐ€ ๋งŽ์ด ๋‚œ๋‹ค. 

    ์•„๋ž˜ ์‚ฌ์ง„์ฒ˜๋Ÿผ UI์ƒ์—์„œ ์˜ค๋ฒ„ํ”Œ๋กœ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค๋Š” ๋…ธ๋ž€์ƒ‰,๊ฒ€์€์ƒ‰ ์ค„๋ฌด๋Šฌ์˜ ์—๋Ÿฌ ํ‘œ์‹œ๋ฅผ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

    Row(
                  // alignment: MainAxisAlignment.end,
                  mainAxisAlignment: MainAxisAlignment.end,
                  // TODO: Add a beveled rectangular border to CANCEL (103)
                  children: <Widget>[
                    // TODO: Add buttons (101)
                    TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ),
                    // TODO: Add an elevation to NEXT (103)
                    // TODO: Add a beveled rectangular border to NEXT (103)
                    ElevatedButton(
                      child: const Text('NEXT'),
                      onPressed: () {
                        // TODO: Show the next page (101)
                        Navigator.pop(context);
                      },
                    ),
                  ],
                ),

    ์ด๋Ÿด ๊ฒฝ์šฐ Expended๋‚˜ flexible๋กœ ๊ฐ์‹ธ์„œ Row๋ฅผ ๊ทธ๋ ค์ค˜์•ผ ํ•œ๋‹ค.

    ์ด๋ ‡๊ฒŒ!!

    Expended(
    		child:Row(
                  // alignment: MainAxisAlignment.end,
                  mainAxisAlignment: MainAxisAlignment.end,
                  // TODO: Add a beveled rectangular border to CANCEL (103)
                  children: <Widget>[
                    // TODO: Add buttons (101)
                    TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ),
                    // TODO: Add an elevation to NEXT (103)
                    // TODO: Add a beveled rectangular border to NEXT (103)
                    ElevatedButton(
                      child: const Text('NEXT'),
                      onPressed: () {
                        // TODO: Show the next page (101)
                        Navigator.pop(context);
                      },
                    ),
                  ],
                ),
               )

     

    ๊ทธ๋Ÿฐ๋ฐ!

    Flutter๊ฐ€ ์š”์ฆ˜ ๋ฐ˜์‘ํ˜•์— ๋„ˆ๋ฌด ์ž˜ ๋˜์–ด์žˆ๋‹ค ๐Ÿซข

    ๋ง๊ทธ๋Œ€๋กœ ์‚ฌ์šฉ๊ณต๊ฐ„์ด ์ข์•„์งˆ ๊ฒฝ์šฐ ์—ด๋กœ ๋Œ€์‹ ํ•˜์—ฌ ๋ฐฐ์น˜ํ•˜๊ฒŒ ๋œ๋‹คใ…Ž

    ๋ณดํ†ต ์ด๋ ‡๊ฒŒ ํ•˜๋ ค๋ฉด ๋ถ€๋ชจ๋ทฐ์˜ ๋„“์ด ๊ฐ’์„ ๊ฐ€์ง€๊ณ  ์™€์„œ ์ž์‹๋ทฐ์— ๋ฐฐ์น˜ํ•œ ๋ทฐ๋“ค์˜ ๋„“์ด๊ฐ’์„ ๊ฐ€์ง€๊ณ  ์™€์„œ ๋„“์ด๋ฅผ ๊ตฌํ•˜์„œ ๊ณ„์‚ฐํ•ด์„œ...

    ์ด๊ฑธ ์•ˆํ•ด๋„ ๋œ๋‹ค !! ใ…Žใ…Ž ์ง„์งœ ์ข‹์€ ํด๋ž˜์Šค!!  ์ด๋ฆ„๋„ overflow๊ฐ€..ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹

    ์ฝ”๋“œ๋Š” Row ๋Œ€์‹  OverflowBar๋ฅผ ์“ฐ๋ฉด ๋œ๋‹ค.

    OverflowBar(
                  alignment: MainAxisAlignment.end, 
                  // TODO: Add a beveled rectangular border to CANCEL (103)
                  children: <Widget>[
                    // TODO: Add buttons (101)
                    TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ), TextButton(
                      child: const Text('CANCEL'),
                      onPressed: () {
                        // TODO: Clear the text fields (101)
                        _usernameController.clear();
                        _passwordController.clear();
                      },
                    ),
                    // TODO: Add an elevation to NEXT (103)
                    // TODO: Add a beveled rectangular border to NEXT (103)
                    ElevatedButton(
                      child: const Text('NEXT'),
                      onPressed: () {
                        // TODO: Show the next page (101)
                        Navigator.pop(context);
                      },
                    ),
                  ],
                ),

     

    ํ•ธ๋“œํฐ๋„ ํฌ๊ธฐ๋ณ„๋กœ ๋Œ€์‘์„ ํ•ด์•ผํ•˜๋Š”๋ฐ ์ด๊ฑฐ ์ •๋ง ์ข‹์€๊ฑฐ ๊ฐ™๋‹ค! ใ…Ž

     

    ๋ฐ˜์‘ํ˜•
Designed by Tistory.