效果图:
![在这里插入图片描述](https://img.php1.cn/3cd4a/1eebe/cd5/086aec93f5e1e9b2.webp)
BottomNavigationBar
先来看一下官方的sample code:
class MyHomePage extends StatefulWidget {MyHomePage({Key key}) : super(key: key);@override_MyHomePageState createState() => _MyHomePageState();
}class _MyHomePageState extends State {int _selectedIndex = 1;final _widgetOptiOns= [Text('Index 0: Home'),Text('Index 1: Business'),Text('Index 2: School'),];@overrideWidget build(BuildContext context) {return Scaffold(appBar: AppBar(title: Text('BottomNavigationBar Sample'),),body: Center(child: _widgetOptions.elementAt(_selectedIndex),),bottomNavigationBar: BottomNavigationBar(items: [BottomNavigationBarIte