ํ”Œ๋Ÿฌํ„ฐ

โ–ช ์™„์„ฑ ํ•  ๋ ˆ์ด์•„์›ƒ ์ € ๋ ˆ์ด์•„์›ƒ์„ ๋งŒ๋“ค์–ด์•ผํ•˜๋Š”๋ฐ, ์ „์ฒด์ ์œผ๋กœ ๊ฐ์‹ผ Container ๊ฐ€ ์žˆ๊ณ , ๊ทธ ์•ˆ์— Column๋กœ ํ•œ๋ฒˆ ๋” ๊ฐ์‹ธ๊ณ , ๊ฐ ๋ ˆ์ด์•„์›ƒ์„ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด์„œ ์„ค๊ณ„ ๊ณ„ํš์„ ์„ธ์› ๋‹ค. Column( children: [ 1. Container - ํ•™๊ต ์ด๋ฉ”์ผ์ด๋ผ๋Š” Text๋ฅผ ์“ธ ๊ฒƒ 2. Row - TextFormField(์ด๋ฉ”์ผ input) , OutlinedButton(์ธ์ฆํ•˜๊ธฐ) 3. SizedBox - input ์‚ฌ์ด์— ๊ฐ„๊ฒฉ์„ ์œ„ํ•ด์„œ 4. TextFormField - ์ธ์ฆ๋ฒˆํ˜ธ ์ž…๋ ฅ input 5. OutlinedButton - ๋‹ค์Œ ๋ฒ„ํŠผ ] ) โ–ช ๋ฌธ์ œ ๋ฐœ์ƒ 1์„ ํ•˜๊ณ  2๋ฒˆ์œผ๋กœ ๋„˜์–ด๊ฐˆ ๋•Œ ์šฐ์„  Row๋ฅผ ์•ˆ ์“ฐ๊ณ , TextFormField๋ฅผ ๋จผ์ € ์ผ๋Š”๋ฐ ํ™”๋ฉด์— ์ถœ๋ ฅ์ด ์•ˆ ๋˜๋Š”๊ฑฐ๋‹ค! ์ด ์ „์— ์œ ํŠœ๋ฒ„ ..
ํ”Œ๋Ÿฌํ„ฐ์—์„œ๋Š” route๋ผ๋Š” ๊ฐœ๋…์œผ๋กœ ํŽ˜์ด์ง€ ์ด๋™์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ์ด ๋•Œ ์ด๋™ํ•  ๊ณณ์„ page๋ผ๊ณ  ์ƒ๊ฐํ•ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ๊ตณ์ด ํŒŒ์ผ์„ ๋”ฐ๋กœ ๋‚˜๋ˆ„์ง€ ์•Š์•„๋„ ๊ฐ™์€ ํŒŒ์ผ ์•ˆ์—์„œ page๋งŒ ๋‚˜๋ˆ ์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ์ฐธ ์‰ฝ์ฃต? ๐Ÿ˜ ์ด๋™ ํ•  ๋•Œ ์“ฐ๋Š” ๊ฒƒ์œผ๋กœ๋Š” Navagator ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. main.dart Container( margin: EdgeInsets.only(top: 100, left: 0), width: 100, child: IconButton( icon: Text('Signup', style: TextStyle(fontSize: 20),), onPressed: (){ Navigator.push(context, MaterialPageRoute(builder: (context) => SignUpPage(..
๋ฐ˜๋ณต๋˜๋Š” ๋ถ€๋ถ„์„ ์†์ˆ˜ ์“ฐ์ง€ ์•Š๊ณ  ๋ฐ˜๋ณตํ•ด์„œ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค. ์ด ๋•Œ ์“ธ ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์ด ListView.builder ์ด๋‹ค. โ—พ Example ์ง€๊ธˆ๋ถ€ํ„ฐ ๋งŒ๋“ค์–ด ๋ณผ ๋ถ€๋ถ„์ธ๋ฐ ๋ณด๋ผ์ƒ‰์ด list_view๋ถ€๋ถ„์ด๊ณ  icons๊ฐ€ ํŒŒ๋ž€์ƒ‰๋ถ€๋ถ„์ด๋‹ค โ—พ Code list_view์— ๋ฐ˜๋ณต๋˜๋Š” ๋ถ€๋ถ„์„ ๋”ฐ๋กœ ํŒŒ์ผ(icons.dart)๋กœ ๋นผ์„œ ๋”ํ•˜๋Š”๊ฑฐ๋‹ค. list_view.dart Container( margin: EdgeInsets.only(top: 10, bottom: 20), child: Text('${descList[index]}'), ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( '${majorList[index]}', style: T..
ListView.builder์„ ์‚ฌ์šฉํ•ด์„œ ๊ตฌํ˜„ํ•˜๋‹ค๊ฐ€ ๋ณธ ๋งˆ์ฃผํ•œ ์—๋Ÿฌ์ด๋‹ค. ๋ฆฌ์ŠคํŠธ๋ฅผ 5๊ฐœ ์ •๋„๋ฅผ ๋งŒ๋“ค์–ด์„œ ๋ฐ˜๋ณต์‹œ์ผฐ๋Š”๋ฐ ์—๋ฎฌ๋ ˆ์ดํ„ฐ ํ™”๋ฉด์— ๋…ธ๋ž€ ๋ฐ”ํƒ•์— ์œ„์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋œฌ๋‹ค. โ—พ ํ•ด๊ฒฐ๋ฐฉ์•ˆ @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('์˜ˆ์ˆ ์ฒด์œกํ•™๊ณผ'), centerTitle: true, backgroundColor: Colors.white, elevation: 0, leading: IconButton( icon: Icon(Icons.arrow_back), color: Colors.grey, iconSize: 25.0, onPressed: () {}, ), actions: [ Container..
โ—พ ์™„์„ฑ๋ชจ์Šต ์•ž์„œ ์•„์ด์ฝ˜์„ ๋„ฃ์–ด์„œ ๋งŒ๋“  ๋ฉ”๋‰ด์— ํ–„๋ฒ„๊ฑฐ ๋ฒ„ํŠผ์„ ๋ˆŒ๋ €์„ ๋•Œ ์‚ฌ์ด๋“œ๋กœ ์—ด๋ฆฌ๋Š” ๋ฉ”๋‰ด๋ฅผ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค! flutter์—์„œ๋Š” drawer์ด๋ผ๋Š” ๊ฒƒ์œผ๋กœ ์‰ฝ๊ฒŒ ๋งŒ๋“ค ์ˆ˜ ๊ฐ€ ์žˆ๋‹ต๋‹ˆ๋‹ค! โ—พ ๊ธฐ๋ณธ ๊ตฌ์„ฑ drawer ์„ ๋งŒ๋“ค๊ณ , ๊ทธ ์•ˆ์— ์ž์‹ ์œ„์ ฏ(child)์œผ๋กœ ListView๋ฅผ ๋งŒ๋“ค์–ด์ค๋‹ˆ๋‹ค. ๊ทธ ์ž์‹ ์œ„์ ฏ ์•ˆ์— ๋˜ ๋‹ค๋ฅธ ํ•˜์œ„ ์œ„์ ฏ(children)์„ ์ƒ์„ฑํ•ด์ค๋‹ˆ๋‹ค. ListView๋Š” ๋‘๊ฐ€์ง€๋กœ ๊ตฌ์„ฑ์ด ๋ฉ๋‹ˆ๋‹ค. ์ผ๋‹จ Header๋ถ€๋ถ„์—์„œ ๊ณ„์ •์ด๋ฆ„, ํ”„๋กœํ•„ ์‚ฌ์ง„ ๋“ฑ์„ ๋„ฃ์–ด์ฃผ๊ณ , ๋‹ค๋ฅธ ํŽ˜์ด์ง€๋กœ ๋„˜์–ด๊ฐˆ ์ˆ˜ ์žˆ๋Š” ๋ฉ”๋‰ด๋ฅผ ListTile์ด๋ผ๋Š” ์ด๋ฆ„ ์•„๋ž˜ ์ƒ์„ฑํ•ด์ค๋‹ˆ๋‹ค ListTile๊ตฌ์„ฑ์— ๋ณด์‹œ๋ฉด onTap์ด ์žˆ๋Š”๋ฐ, ์ด ๋ถ€๋ถ„์€ ๋‚˜์ค‘์— ๊ฐ€๋ฉด ๋” ๊นŠ๊ฒŒ ๊ณต๋ถ€ํ•  ์˜ˆ์ •์ด์ง€๋งŒ ๊ฐ„๋‹จํ•˜๊ฒŒ onPressed์™€ ๋น„๊ตํ•ด๋ณด์ž๋ฉด onPressed๋Š”..
โ—พ ์™„์„ฑ ๋ชจ์Šต โ—พ code class Grade extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.amber[800], appBar: AppBar( title: Text('BBANTO'), centerTitle: true, backgroundColor: Colors.amber[700], elevation: 0.0, //left side leading: IconButton( icon: Icon(Icons.menu), onPressed: () { print('menu button is clicked'); }, ), actions: [ IconButton( ..
1. Flutter์—์„œ ์œ„์ ฏ์ด๋ž€? UI๋ฅผ ๋งŒ๋“ค๊ณ  ๊ตฌ์„ฑํ•˜๋Š” ๋ชจ๋“  ๊ธฐ๋ณธ ๋‹จ์œ„ ์š”์†Œ๋ฅผ ์œ„์ ฏ์ด๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๋ˆˆ์— ๋ณด์ด๋Š” ์š”์†Œ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ๋ณด์ด์ง€ ์•Š๋Š” ์š”์†Œ๋“ค๊นŒ์ง€๋„ ์œ„์ ฏ์ด๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ํ•œ๋งˆ๋””๋กœ Eveything is Widget. 2. ์œ„์ ฏ ํƒ€์ž… Stateless widget ์ƒํƒœ๊ฐ€ ์—†๋Š” ์ •์ ์ธ ์œ„์ ฏ์„ ๋œปํ•ฉ๋‹ˆ๋‹ค. ์Šคํฌ๋ฆฐ์ƒ์— ์กด์žฌ๋Š” ํ•˜์ง€๋งŒ ์•„๋ฌด๊ฒƒ๋„ ๊ฐ€์ง€์ง€ ์•Š๊ณ , ์‹ค์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ ์ €์žฅ์„ ๋ชปํ•˜๋Š” ์œ„์ ฏ์ž…๋‹ˆ๋‹ค. ์–ด๋– ํ•œ ์ƒํƒฑ๋ฅผ ์œ ๋ฐœํ•˜๋Š” value ๊ฐ’๋„ ๊ฐ€์ง€์ง€ ์•Š๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด์„œ image, text Stateful widget ์–ด๋–ค ์ƒํƒœ๋ฅผ ๊ฐ€์ง€๊ณ  ๊ณ„์† ์›€์ง์ž„์ด๋‚˜ ๋ณ€ํ™”๊ฐ€ ์žˆ๋Š” ์œ„์ ฏ ์‚ฌ์šฉ์ž ์ธํ„ฐ๋ž™์…˜์— ๋”ฐ๋ผ์„œ ๋‹ฌ๋ผ์ง€๋Š” ์œ„์ ฏ์ž…๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด input, checkbox 3. ์œ„์ ฏ ๊ตฌ์„ฑ(ํŠธ๋ฆฌ) ์œ„์˜ ์„ค๋ช…์ฒ˜๋Ÿผ ๋งŽ์€ ์š”์†Œ๋“ค์ด ์œ„..
๋ฐ(Ming) ๐Ÿฐ
'ํ”Œ๋Ÿฌํ„ฐ' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก (2 Page)