
#Flutter scaffold bottomnavigationbar code
To create a local project with this code sample, run:įlutter create -sample=material.BottomNavigationBar.3 mysample In thisĬase it's assumed that each item will have a different background colorĪnd that background color will contrast well with white.

The navigation bar's background color is the same as theīottomNavigationBarItem.backgroundColor of the selected item. If selectedItemColor is null, all items are rendered BottomNavigationBarType.shifting, the default when there are four.Navigation bar's background color defaults to the Material backgroundĬolor, ThemeData.canvasColor (essentially opaque white). SelectedItemColor if it's non-null, otherwise the theme'sĬolorScheme.primary color is used for Brightness.light themesĪnd condary for Brightness.dark themes. BottomNavigationBarType.fixed, the default when there are less thanįour items.The length of items must be at least two and each item's icon and title/label

If not specified, then it's automatically set toīottomNavigationBarType.fixed when there are less than four items, andīottomNavigationBarType.shifting otherwise. The bottom navigation bar's type changes how its items are displayed. Where it is provided as the Scaffold.bottomNavigationBar argument. Screens, side navigation may be a better fit.Ī bottom navigation bar is usually used in conjunction with a Scaffold,

Provides quick navigation between the top-level views of an app. Text labels, icons, or both, laid out on top of a piece of material. The bottom navigation bar consists of multiple items in the form of A material widget that's displayed at the bottom of an app for selectingĪmong a small number of views, typically between three and five.
