Scaffold(
bottomNavigationBar: BottomNavigationBar(
unselectedItemColor: Colors.grey,
items: const <BottomNavigationBarItem> [
BottomNavigationBarItem(icon: Icon(Icons.home),label: "First"),
BottomNavigationBarItem(icon: Icon(Icons.business), label: "business"),
BottomNavigationBarItem(icon: Icon(Icons.person), label: "MyHome"),
],
currentIndex: _selectedIndex,
fixedColor: Colors.blue,
onTap: _onItemTapped,
),
)
BottomNavigationBarItem里面title用不了,要使用label。并且label值不能为空。