-
앱 개발 입문 수강 기록 4일 차_2023-02-23Study 2023. 2. 23. 21:32
오늘부터는 마크다운으로 입력하기 귀찮아서(예쁘게 되지도 않고) 일반모드로 작성
강좌명
CH01_05. UI 만들어보기 (앱의 타이틀, 화면에 표시되는 텍스트 표현 등)
- UI 만들기
- AppBar
- 앱 페이지 상단에 고정된 위젯
- 페이지 이동 및 페이지 저장 버튼을 추가 가능
- FloatingActionButton
- 페이지 하단에 떠있는 버튼 위젯
- BottomNavigationBar
- 다양한 페이지를 선택할 수 있는 하단 고정 위젯
- BottomSheet
- 여러 액션을 사용할 수 있는 하단 고정 위젯
- 실습 코드
- 기존 내용에서 BottomNavigationBar, BottomNavigationBarItem 추가
- BottomNavigationBar 정의 내용 확인
- AppBar
import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: const MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({super.key, required this.title}); final String title; @override State<MyHomePage> createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { int _counter = 0; int _idx = 0; void _incrementCounter() { setState(() { _counter++; }); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("패스트캠퍼스 테스트"), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ const Text( '패스트캠퍼스 강의입니다.', ), Text( '$_counter', style: Theme.of(context).textTheme.headlineMedium, ), Container(child: Text("난 컨테이너 안이에요"), color: Colors.redAccent,), TextButton( child: Text("난 텍스트 버튼!"), onPressed: (){ print("텍스트버튼 눌림!"); }, ) ], ), ), floatingActionButton: FloatingActionButton( onPressed: _incrementCounter, tooltip: 'Increment', child: const Icon(Icons.add), ), bottomNavigationBar: BottomNavigationBar( items: const [ BottomNavigationBarItem( icon: Icon(Icons.home), label: "홈" ), BottomNavigationBarItem( icon: Icon(Icons.more), label: "더보기탭" ), BottomNavigationBarItem( icon: Icon(Icons.more), label: "더보기탭2" ) ], onTap: (index){ setState(() { _idx = index; }); }, currentIndex: _idx, ) ); } }
BottomNavigationBar({ super.key, required this.items, this.onTap, this.currentIndex = 0, this.elevation, this.type, Color? fixedColor, this.backgroundColor, this.iconSize = 24.0, Color? selectedItemColor, this.unselectedItemColor, this.selectedIconTheme, this.unselectedIconTheme, this.selectedFontSize = 14.0, this.unselectedFontSize = 12.0, this.selectedLabelStyle, this.unselectedLabelStyle, this.showSelectedLabels, this.showUnselectedLabels, this.mouseCursor, this.enableFeedback, this.landscapeLayout, this.useLegacyColorScheme = true, }) : assert(items != null), assert(items.length >= 2), assert( items.every((BottomNavigationBarItem item) => item.label != null), 'Every item must have a non-null label', ), assert(0 <= currentIndex && currentIndex < items.length), assert(elevation == null || elevation >= 0.0), assert(iconSize != null && iconSize >= 0.0), assert( selectedItemColor == null || fixedColor == null, 'Either selectedItemColor or fixedColor can be specified, but not both', ), assert(selectedFontSize != null && selectedFontSize >= 0.0), assert(unselectedFontSize != null && unselectedFontSize >= 0.0), selectedItemColor = selectedItemColor ?? fixedColor;
- UI 만들기 - Cupertino
- iOS 디자인 위젯
- CupertinoActionSheet
- iOS 버전 BottomSheet 위젯
- CupertinoSegmentedControl
- 옵션 선택 가능한 위젯
- CupertinoAlertDialog
- iOS 디자인 다이얼로그 위젯
- CupertinoSwitch
- iOS 디자인 스위치 위젯
- iOS 디자인 위젯
- 정리
- 아직 안드로이드 모바일 에러는 해결하지 못함
- 안드로이드 스튜디오에서 자동완성으로 뜨는 구문과 강의에서 하는 구문이 다르다.
- Ver. 3.x와 Ver. 1.x의 차이인가?
- 위젯의 위치 설정을 따로 하지 않아도 알아서 나눠주는 게 편리하네.
#패스트캠퍼스 #패캠챌린지 #수강료0원챌린지
#직장인인강 #직장인자기계발 #패캠인강후기 #패스트캠퍼스후기
#환급챌린지 #오공완 #누적다운로드120만1인개발자와함께하는앱개발입문Online
http://bit.ly/3Y34pE0본 포스팅은 패스트캠퍼스 환급 챌린지 참여를 위해 작성되었습니다.
'Study' 카테고리의 다른 글
앱 개발 입문 수강 기록 6일 차_2023-02-25 (0) 2023.02.25 앱 개발 입문 수강 기록 5일 차_2023-02-24 (0) 2023.02.24 앱 개발 입문 수강 기록 3일 차_2023-02-22 (0) 2023.02.22 앱 개발 입문 수강 기록 2일 차_2023-02-21 (0) 2023.02.21 앱 개발 입문 수강 기록 1일 차_2023-02-20 (0) 2023.02.20 - UI 만들기