When I started to work on my app there were 3 items on the BottomNavigationBar. It worked well, then I added one more item and the background color changed to white. If I remove one item, the background color is set to mainBgColor
This is my code so far:
bottomNavigationBar: BottomNavigationBar(
unselectedItemColor: secondaryColor.withOpacity(0.5),
selectedItemColor: secondaryColor,
elevation: 5,
backgroundColor: mainBgColor,
currentIndex: widget.index,
onTap: _onItemTapped,
items: const [
BottomNavigationBarItem(
icon: Icon(
Icons.add,
size: 20.0,
),
label: 'New'),
BottomNavigationBarItem(
icon: Icon(
Icons.near_me,
size: 20.0,
),
label: 'Find'),
BottomNavigationBarItem(
icon: Icon(
Icons.wallet,
size: 20.0,
),
label: 'Wallet'),
BottomNavigationBarItem(
icon: Icon(
Icons.wallet,
size: 20.0,
),
label: ''),
],
),
How could I set the required background color?