Skip to content

BottomNavigationBar does not respect theme in shifting mode #27753

@matthew-carroll

Description

@matthew-carroll

BottomNavigationBar appears to stop respecting the app theme when it goes from a fixed mode to a shifting mode.

Repro steps:

  1. Start with a BottomNavigationBar that has 3 tabs, in an app with a light theme and dark icons:
    BottomNavigationBar(
        currentIndex: _activeTabIndex,
        items: [
          BottomNavigationBarItem(
            icon: Icon(Icons.play_circle_filled),
            title: Text('Demo'),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.style),
            title: Text('Inspiration'),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.accessibility),
            title: Text('Anatomy'),
          ),
        ]
    ),
  1. Add a 4th tab. This automatically changes the bar to shifting mode. Notice that the background of the bar remains light, but now the icons go from dark to light which makes them barely visible:
    BottomNavigationBar(
        currentIndex: _activeTabIndex,
        items: [
          BottomNavigationBarItem(
            icon: Icon(Icons.play_circle_filled),
            title: Text('Demo'),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.style),
            title: Text('Inspiration'),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.accessibility),
            title: Text('Anatomy'),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.compare),
            title: Text('Catalog'),
          ),
        ]
    ),
  1. Explicitly change the BottomNavigationBar to use the fixed mode. Notice that the icons regain their correct, dark tint:
    BottomNavigationBar(
        currentIndex: _activeTabIndex,
        type: BottomNavigationBarType.fixed,
        items: [
          BottomNavigationBarItem(
            icon: Icon(Icons.play_circle_filled),
            title: Text('Demo'),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.style),
            title: Text('Inspiration'),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.accessibility),
            title: Text('Anatomy'),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.compare),
            title: Text('Catalog'),
          ),
        ]
    ),

Flutter Doctor:
Flutter (Channel master, v1.1.6-pre.27, on Mac OS X 10.13.6 17G65, locale en-US)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms bettera: qualityA truly polished experiencef: material designflutter/packages/flutter/material repository.found in release: 1.22Found to occur in 1.22found in release: 1.26Found to occur in 1.26frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions