— Flutter, Widgets — 1 min read
If you're using the BottomNavigationBarItem widget in your Flutter app you might not want to have text under the icon, but it forces you to use the 'title' prop for some reason which is kind of annoying.
Anyway either either of the following two approaches should get rid of the text for you.
1bottomNavigationBar: BottomNavigationBar(2 items: [3 BottomNavigationBarItem(icon: Icon(Icons.star, color: Colors.red,), title: Container()),4 BottomNavigationBarItem(icon: Icon(Icons.map, color: Colors.red,), title: Container()),5 ]6),
1bottomNavigationBar: BottomNavigationBar(2 items: [3 BottomNavigationBarItem(icon: Icon(Icons.map, color: Colors.red,), title: Padding(padding: EdgeInsets.all(0)),4 BottomNavigationBarItem(icon: Icon(Icons.print, color: Colors.red,), title: Padding(padding: EdgeInsets.all(0))),5 ]6)