Flutter - How to add TextStyle to label in BottomNavigationBarItem?

Viewed 837

I have a BottomNavigationBar() in my app however after I updated to Flutter 1.22 the title parameter is deprecated. As the new label only takes a String input I cannot pass the Text() widget to pass a custom TextStyle. How do I achieve this now with the new update?

BottomNavigationBarItem(icon: Icon(Icons.notifications), label: 'tickets'),
BottomNavigationBarItem(icon: Icon(CustomIcons.calendar), label: 'calendar'),
BottomNavigationBarItem(icon: Icon(CustomIcons.home), label: 'home'),
BottomNavigationBarItem(icon: Icon(CustomIcons.podcasts), label: 'microphone'),
BottomNavigationBarItem(icon: Icon(CustomIcons.search), label: 'search')
1 Answers
BottomNavigationBar(
   selectedLabelStyle: TextStyle(),//your text style
   unselectedLabelStyle: TextStyle(),// your text style
   items: [
     BottomNavigationBarItem(icon: Icon(Icons.notifications), label: 'tickets'),
     BottomNavigationBarItem(icon: Icon(CustomIcons.calendar), label: 'calendar'),
     BottomNavigationBarItem(icon: Icon(CustomIcons.home), label: 'home'),
     BottomNavigationBarItem(icon: Icon(CustomIcons.podcasts), label: 
     'microphone'),
     BottomNavigationBarItem(icon: Icon(CustomIcons.search), label: 'search'),
   ]
)
Related