I found that the bottom navigation bar items are not properly center aligned in some iphones which have the default safe areas in those.For eg:In this picture the items are not properly center aligned. How can I canter align these items properly?
But in here the items are properly aligned.
My code is:
Scaffold(
body: _children[watch(tabviewProvider).currentBottomNavIndex],
bottomNavigationBar: Container(
height: watch(tabviewProvider).isBottomTabbarHide ? 0.0 : (SizeConfig.blockSizeVertical)*10, //94
decoration: BoxDecoration(
color: Colors.orange,//Todo:remove
boxShadow: <BoxShadow>[
BoxShadow(
color: Color(0xffE5E5E5),
blurRadius: 5,
),
],
),
child: Align(
alignment: Alignment.center,
child: BottomNavigationBar(
backgroundColor: Colors.grey, //Todo:remove
// backgroundColor: Color(0xffF7F3ED),
selectedFontSize: 0,
showSelectedLabels: false,
showUnselectedLabels: false,
type: BottomNavigationBarType.fixed,
key: bottomNavGlobalKey,
onTap: onTabTapped,
currentIndex: watch(tabviewProvider).currentBottomNavIndex,
items: [
BottomNavigationBarItem(
activeIcon: BottmNavTabButton(
isActive: true,
imgPath: 'assets/icons/icon_timeline_pink.svg',
lableText: 'A',
),
label: '',
icon: BottmNavTabButton(
isActive: false,
imgPath: 'assets/icons/icon_timeline_gray.svg',
lableText: 'A',
),
),
BottomNavigationBarItem(
activeIcon: BottmNavTabButton(
isActive: true,
imgPath: 'assets/icons/icon_knowledge_pink.svg',
lableText: 'B',
),
label: '',
icon: BottmNavTabButton(
isActive: false,
imgPath: 'assets/icons/icon_knowledge_gray.svg',
lableText: 'B',
),
),
BottomNavigationBarItem(
activeIcon: BottmNavTabButton(
isActive: true,
imgPath: 'assets/icons/icon_offer_pink.svg',
lableText: 'C',
),
label: '',
icon: BottmNavTabButton(
isActive: false,
imgPath: 'assets/icons/icon_offer_gray.svg',
lableText: 'C',
),
)
],
),
),
),
);