The Label Color doesn't change on the BottomNavigationBar

464

Change this

selectedLabelStyle: TextStyle(color: Colors.black),
unselectedLabelStyle: TextStyle(color: Colors.black),

To this:

selectedItemColor: Colors.black,
unselectedItemColor: Colors.black,
Share:
464

Related videos on Youtube

Tom
Author by

Tom

Updated on December 01, 2022

Comments

  • Tom
    Tom over 1 year

    The color of the labels of my selected and unselected BottomNavigationBarItems doesn't change... what am I doing wrong? Here is the code:

    bottomNavigationBar: BottomNavigationBar(
            selectedLabelStyle: TextStyle(color: Colors.black),
            unselectedLabelStyle: TextStyle(color: Colors.black),
            backgroundColor: Colors.white,
            
            onTap: onTabTapped,
            currentIndex: _currentIndex, // this will be set when a new tab is tapped
            items: [
              BottomNavigationBarItem(
                icon: Icon(Icons.home, color: Colors.black,),
                label: 'Home',
    
              ),
              BottomNavigationBarItem(
                icon: Icon(Icons.search, color: Colors.black,),
                label: 'Messages',
              ),
              BottomNavigationBarItem(
                  icon: Icon(Icons.person, color: Colors.black,),
                  label: 'Profile'
              )
            ],
          ),
    
    • Wilf
      Wilf over 8 years
      if you deleted the partition table you have the lost the Windows 8 partitions - you may be able to recover some data using the steps here (except you may not have overwritten the partitons). Always make a backup before doing any system installing/upgrading stuff.