-
[Flutter] Row๋ณด๋จ OverflowBar ๐๊ฐ๋ฐ/Flutter๐ฑ 2023. 8. 17. 20:04
๐
์๊ณ ๊ณต๋ถ ๋จธํฐ๋ฆฌ์ผ ๊ตฌ์ฑ์์ ๊ณต๋ถํ๋ค๊ฐ ์๊ฒ๋ ์์ ฏ! ใ
ํ์์ ์์ผ๋ก ๋์ดํ ๋ 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); }, ), ], ),
ํธ๋ํฐ๋ ํฌ๊ธฐ๋ณ๋ก ๋์์ ํด์ผํ๋๋ฐ ์ด๊ฑฐ ์ ๋ง ์ข์๊ฑฐ ๊ฐ๋ค! ใ
๋ฐ์ํ'๊ฐ๋ฐ > Flutter๐ฑ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Flutter] ์ฒ์ Flutter ์ ๋ฌธ์๋ผ๋ฉด ํ๋ฒ ๋ณด๋ฉด ์ข์ ๋จธํฐ๋ฆฌ์ผ ๊ตฌ์ฑ์์ ๊ธฐ๋ณธ์ฌํญ ๐ (0) 2023.08.16 [Flutter] ์ฑ ํ ์คํธ ํ๋ ๋ฐฉ๋ฒ (CodeLab) (0) 2023.08.08