how to make a BottomNavigationBarItem not clickable in flutter
You can do something like below:
Your bottomNavigationBar
bottomNavigationBar: BottomNavigationBar(
items: [
BottomNavigationBarItem(
...
),
BottomNavigationBarItem(
...
),
BottomNavigationBarItem(
...
),
],
onTap: navigationTapped,
currentIndex: _page,
),
You can add the conditional check whether the page index match with the current index than don't do anything and return from that point.
Like page == index
Where, index is position of the BottomNavigationBarItem
void navigationTapped(int page) {
if (page == 1) {
return;
} else {
setState(() {
_selectedIndex = page;
});
}
}