06. 리스트뷰 빌터, 버튼에 기능 넣기
리스트뷰 빌더 형태. 아이템 카운트에 반복횟수, 아이템 빌더에 c, i 변수 두개 넣고 만든다. 리스트 타일을 쓰면 리딩과 타이틀 파라미터 활용할 수 있다 return MaterialApp( home: Scaffold( appBar: AppBar(), bottomNavigationBar: BottomTab(), body: ListView.builder( itemCount: 3, itemBuilder: (c,i){ return ListTile( leading: Image.asset('profile.jpg'), title: Text('James') ); }, ), ), ); } } class BottomTab extends StatelessWidget { const BottomTab({Key? key}) :..
2024. 3. 7.
04. 당근st 모바일 화면 구성(expanded, flexible)
Flexible을 사용하면 화면을 flex로 비율대로 나눠준다 body:Row( children: [ Flexible(child: Container(color:Colors.green), flex: 3,), Flexible(child: Container(color:Colors.yellow), flex: 7,), ], ), Expanded를 사용하면 1가진 플렉서블 박스랑 똑같다. 박스 하나만 꽉 채우고 싶다면 익스펜디드를 사용한다! 박스폭을 %로 주고 싶으면 플렉서블 박스 하나 넓게 채우려면 익스펜디드 body:Row( children: [ Container(width:200, color:Colors.yellow), Expanded(child: Container(color:Colors.green)), ],..
2024. 2. 29.
03. 타이포그라피, 앱바 구성
텍스트 꾸미기는 텍스트 스타일 파라미터 안에서 처리할 수 있다. 앱바에서 좌상단 아이콘은 리딩, 오른쪽 아이콘들은 액션즈 파라미터를 사용한다. return MaterialApp( home: Scaffold( appBar: AppBar( leading:Icon(Icons.dehaze), title: Text('APP'), actions: [Icon(Icons.favorite), Icon(Icons.access_alarms),Icon(Icons.account_tree_outlined)], ), body: Column( children: [ SizedBox( child: Text('hi', style: TextStyle( color: Color.fromRGBO(102,000,102, 0.9), fontSize..
2024. 2. 29.