This is my bottom navigation:
This is my code:
CupertinoTabScaffold(
tabBar: CupertinoTabBar(
backgroundColor: const Color(0xFF142634),
activeColor: Colors.orange,
inactiveColor: Colors.white,
items: const [
BottomNavigationBarItem(icon: Icon(Icons.home)),
BottomNavigationBarItem(icon: Icon(Icons.sports_basketball)),
BottomNavigationBarItem(icon: Icon(Icons.event)),
BottomNavigationBarItem(icon: Icon(Icons.account_balance_sharp))
]),
tabBuilder: (context, index) {
switch (index) {
case 1:
return CupertinoTabView(
builder: (context) => const BasketballPage());
case 2:
return CupertinoTabView(builder: (context) => const Events());
case 3:
return CupertinoTabView(
builder: (context) => const Standings());
case 0:
default:
return CupertinoTabView(builder: (context) => const Home());
}
}),
Is there a simple way for when you are a few stacks into one of the navigation, you can press the icon on the bottom and it will take u back to the route page. I tried using GestureDector and onTap, but I couldn't find where in the code that would work.
For example, in the picture above, let's say that you are a few routes deep into that tab view, and you want to go home just by pressing on that columns/house icon. How would I be able to do that with my code right now.