参考:jianshu.com/p/22d8974c5e04
return Scaffold( backgroundColor: Color(0xfff6f6f6), bottomNavigationBar: BottomNavigationBar( type: BottomNavigationBarType.fixed, onTap: _onTap,
selectedItemColor: Theme.of(context).primaryColor, // 选中的item颜色 unselectedItemColor: Color(0xff666666), // 未选中的item颜色 selectedIconTheme: IconThemeData(color: Colors.blue, size: AppConfig.screenUtil(val: 50, val2: 20)), // 选中的icon样式 unselectedIconTheme: IconThemeData(color: Colors.black, size: AppConfig.screenUtil(val: 50, val2: 20)), // 未选择的icon样式 selectedFontSize: AppConfig.screenUtil(val: 25, val2: 20), // 选择的item文字大小 unselectedFontSize: AppConfig.screenUtil(val: 25, val2: 20), // 未选择的item文字大小 currentIndex: _currentIndex,
//被选择item的颜色 items: <BottomNavigationBarItem>[ BottomNavigationBarItem(title: Text('首页', ), icon: Icon( Icons.home,)), BottomNavigationBarItem(title: Text('全部产品', ), icon: Icon( IconData(0xe7f9, fontFamily: 'iconfont'),)), BottomNavigationBarItem( title: Text('产品分类'), icon: Icon( IconData(0xe7f9, fontFamily: 'iconfont'),)), ], ),