Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

The space between the items in the Bottom Navigation Bar

  bottomNavigationBar: BottomNavigationBar(
    showSelectedLabels: false,
    showUnselectedLabels: false,
    items: const <BottomNavigationBarItem>[
      BottomNavigationBarItem(
        icon: FaIcon(
          FontAwesomeIcons.solidCompass,
          color: darkblue,
        ),
        label: 'Home',
      ),
      BottomNavigationBarItem(
        icon: FaIcon(
          FontAwesomeIcons.route,
          color: darkblue,
        ),
        label: 'Routes',
      ),
      BottomNavigationBarItem(
        icon: FaIcon(
          FontAwesomeIcons.circlePlus,
          color: darkblue,
        ),
        label: 'Add',
      ),
      BottomNavigationBarItem(
        icon: FaIcon(
          FontAwesomeIcons.solidMessage,
          color: darkblue,
        ),
        label: 'Chat',
      ),
    ],

enter image description here

I created such a BottomNavigationBar and added items to it, but the first item looks very separate from the others. How do I get the spacing between all items to be the same?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You need to set "type: BottomNavigationBarType.fixed," to set the same width on all the items. The space you see is on the selected index.

Like this:

BottomNavigationBar(
    type: BottomNavigationBarType.fixed,
    ...
)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading