1

When I use colors like black87 (first image) or black54, I get a weird line one the nav bar, it doesn't happen with other colors. Also, when I set it to transparent, it just looks the same as the true black version (image 4).

Examples:

Black87

Bluegrey

Yellow

Black

Red

Part of the code where I change the colors:

bottomNavigationBar: BottomNavigationBar(
    backgroundColor: Colors.black87,
      items: const <BottomNavigationBarItem>[

        BottomNavigationBarItem(
            icon: Icon(Icons.home,
            color: Colors.greenAccent,
        ),
            title: Text('Home', style: TextStyle(color:Colors.greenAccent)),
        ),

      //same thing for each nav bar item

  type: BottomNavigationBarType.fixed,
      currentIndex: _selectedIndex,
      selectedItemColor: Colors.black87,
      iconSize: 30,
      onTap: _onItemTapped,
      elevation: 7
Mina
  • 315
  • 1
  • 5
  • 16

1 Answers1

1

Those values of Black are including some opacity. Black54 is black with 54% opacity for example !

I guess you're probably seeing another widget behind your bottom nav bar and it explains the "weird line"

FDuhen
  • 4,097
  • 1
  • 15
  • 26
  • That makes sense, but why doesn't it happen on other devices, or even with lighter colors like grey[900]? – Mina Apr 03 '21 at 15:21