I need to make the notch margin spacing (space between FAB's sides and bottomNavBar) transparent and give my bottomNavbar a gradient color like so :
This works perfectly fine when I work with only a bottom appbar, but I need it to work with BottomNavigationBar
too. For now, I've been able to keep the notch transparent, but when I add container with decoration box to give it linear gradient color the transparency disappears. This is my implementation :
bottomNavigationBar: BottomAppBar(
shape: CircularNotchedRectangle(),
color: Theme.of(context).primaryColor.withAlpha(255),
elevation: 0,
child: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
selectedItemColor: Colors.blueAccent,
onTap: (int index) {
_selectTab(pageKeys[index], index);
},
currentIndex: _selectedIndex,
elevation: 0,
backgroundColor: Theme.of(context).primaryColor.withAlpha(0),
items: [
BottomNavigationBarItem(
icon: Icon(Icons.ac_unit_outlined,
size: 20,
color: Theme.of(context).colorScheme.onBackground),
label: 'Page 1'),
BottomNavigationBarItem(
icon: Icon(Icons.access_alarm,
size: 20,
color: Theme.of(context).colorScheme.onBackground),
label: 'Page2'),
BottomNavigationBarItem(
icon: Icon(Icons.access_alarm,
size: 20,
color: Theme.of(context).colorScheme.onBackground),
label: 'Page3'),
BottomNavigationBarItem(
icon: Icon(Icons.access_alarm,
size: 20,
color: Theme.of(context).colorScheme.onBackground),
label: 'Page4'),
],
),
),
I want to be able to give my bottomnavbar a transparent notch and a gradient color. How can I do this?