**이 페이지에서 알 수 있는 내용 このページからわかること
- BottomNavationBar
- BottomNavigationBarItem
- currentIndex
- onTap**
main.dart
class _MyHomePageState extends State<MyHomePage> {
int selectedIndex = 0;
@override
Widget build(BuildContext context) { // 시작 지점 読み込み開始
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
],
),
),
bottomNavigationBar: BottomNavigationBar(
items: [
BottomNavigationBarItem(icon: Icon(Icons.add),label: '追加'),
BottomNavigationBarItem(icon: Icon(Icons.remove),label: '削除')
],
currentIndex: selectedIndex,
onTap: (index) {
selectedIndex = index;
setState(() {
});
},
),
);
}
}

BottomNavationBar
앱 하단에 페이징 할 수 있도록 목록을 가진 위젯
アプリの下にページングできるようにリストを持つウイジェット
BottomNavigationBarItem
BottomNavationBar가 가지고 있는 페이지 버튼
BottomNavationBarが持っているページボタン
currentIndex
BottomNavationBar의 초기 세팅 된 페이지 번호
BottomNavationBarの初期設定されたページの番号
onTap
BottomNavationBar의 목록을 눌렀을 때 어떤 동작을 할 것인지 정의하는 프로퍼티
BottomNavationBarのリストを押した時どんな動作をするかを定義するプロパティ
onTap 프로퍼티, setState( ), selectedIndex변수를 통해 BottomNavationBar 위젯의 페이지를 변경했을 때 시작 지점부터 화면을 다시 그리면서 해당 페이지가 보이도록 할 수 있음
onTapプロパティ、setState( )、selectedIndex変数を通してBottomNavationBarウィジェットのページを変更するとき、読み込み開始部分から画面を描く直しながらそのページが見えるようにする