**이 페이지에서 알 수 있는 내용 このページからわかること

- 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(() {
          });
        },
      ),
    );
  }
}

Untitled

BottomNavationBar


BottomNavigationBarItem

currentIndex

onTap

onTap 프로퍼티, setState( ), selectedIndex변수를 통해 BottomNavationBar 위젯의 페이지를 변경했을 때 시작 지점부터 화면을 다시 그리면서 해당 페이지가 보이도록 할 수 있음

onTapプロパティ、setState( )、selectedIndex変数を通してBottomNavationBarウィジェットのページを変更するとき、読み込み開始部分から画面を描く直しながらそのページが見えるようにする