onTap property

ValueChanged<int>? onTap

Called when one of the items is tapped.

The stateful widget that creates the bottom navigation bar needs to keep track of the index of the selected BottomNavigationBarItem and call setState to rebuild the bottom navigation bar with the new currentIndex.


final ValueChanged<int>? onTap;