Skip to content
DeveloperMemos

Remove title from BottomNavigationBarItem

Flutter, Widgets1 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.

Pass a blank Container widget

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),

Pass an "empty" Padding Widget

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)