I am facing issue regarding bottom navigation bar.Example if suppose i have 3 bottom navigation bar item and its A,B and C.If i click on the C and C is the settings screen and on settings screen i also push on another screen.In this scenario the bottom navigation bar is showing but when after click in the setting screen in user details option and then click on the A or B Tab that time tab is coming but it is behind user details screen.So how to managed this scenario?
Asked
Active
Viewed 1,191 times
1 Answers
1
In your screen define this
List<Widget> pageList = [
const HomeScreen(),
const ContactScreen(),
const SettingScreen(),
];
In body use it like this
return Scaffold(
bottomNavigationBar: BottomNavigationBar(
backgroundColor: Colors.white,
type: BottomNavigationBarType.fixed,
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.contact),
label: 'Contact',
),
BottomNavigationBarItem(
icon: Icon(Icons.settings)
label: 'Settings',
),
],
currentIndex: tabSelectedIndex.value,
selectedItemColor: colorPrimary,
unselectedItemColor: colorGrey,
onTap: (index) => setState(() {
_selectedIndex = index;
}),
body:pageList.elementAt(_selectedIndex)
);

Ravin Laheri
- 801
- 3
- 11
-
Bottom navigation bar is working fine but i am facing issue of when on setting screen click on the option for user details screen and after that user direct click on the another tab then that tab screen going behind the user details screen after click on back button of user details screen then able to see tab screen. – Kesmi Topiwala Aug 30 '22 at 04:24