I want to add on tap function to my bottom nav bar items, My code looks like this:
BottomNavigationBarItem(
icon: Icon(
Icons.settings,
color: Colors.grey,
)
)
I want to add on tap function to my bottom nav bar items, My code looks like this:
BottomNavigationBarItem(
icon: Icon(
Icons.settings,
color: Colors.grey,
)
)
2
Answers
There is an onTap function of BottomNavigationBar , example code
As mentioned in Previous answer the
onTap
function is used to interact with thebottomNavbar
items. Thei
in it is for index.Now in the conditions just add what you want to do when clicked on
bNavBar
items.