can someone help me with this problem. The only solution i have currently found, is to set both showSelectedLabels and showUnselecedLabels to false. However this will remove all the labels, but i only want to remove the label of the add button. If I just use a placeholder "" for label, my add button is off centred horizontally...
button off centered horizontally
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: tabs[_selectedIndex],
),
bottomNavigationBar: BottomNavigationBar(
elevation: 10,
backgroundColor: Colors.white,
type: BottomNavigationBarType.fixed,
selectedIconTheme: IconThemeData(color: kPrimaryMagentaColor),
selectedLabelStyle: TextStyle(fontWeight: FontWeight.w500),
selectedItemColor: Colors.black,
showSelectedLabels: true,
showUnselectedLabels: true,
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Container(
padding: kBottomNavIconLabelSpace,
child: Icon(
FeatherIcons.map,
size: 26.5,
),
),
label: 'Map',
),
BottomNavigationBarItem(
icon: Container(
padding: kBottomNavIconLabelSpace,
child: Icon(
FeatherIcons.compass,
size: 28,
),
),
label: 'Discover',
),
BottomNavigationBarItem(
icon: Container(
decoration: BoxDecoration(
color: kPrimaryMagentaColor,
shape: BoxShape.circle,
),
padding: EdgeInsets.all(10),
child: Icon(
FeatherIcons.plus,
color: Colors.white,
),
),
label: "",
),
BottomNavigationBarItem(
icon: Container(
padding: kBottomNavIconLabelSpace,
child: Transform(
alignment: Alignment.center,
transform: Matrix4.rotationY(math.pi),
child: Icon(
FeatherIcons.messageSquare,
size: 28,
),
),
),
label: 'Inbox',
),
BottomNavigationBarItem(
icon: Container(
padding: kBottomNavIconLabelSpace,
child: Icon(
FeatherIcons.calendar,
size: 28,
),
),
label: 'My Activity',
),
],
currentIndex: _selectedIndex,
onTap: _onItemTapped,
),
);