BottomNavigationBar

Flutter's BottomNavigationBar widget is a material design widget that is used to display a horizontal row of buttons at the bottom of the screen, typically for navigation purposes.

Example:

BottomNavigationBar(
  items: const <BottomNavigationBarItem>[
    BottomNavigationBarItem(
      icon: Icon(Icons.home),
      label: 'Home',
    ),
    BottomNavigationBarItem(
      icon: Icon(Icons.favorite),
      label: 'Favorites',
    ),
    BottomNavigationBarItem(
      icon: Icon(Icons.person),
      label: 'Profile',
    ),
  ],
  currentIndex: _selectedIndex,
  onTap: _onItemTapped,
)

In the above example, we have created a BottomNavigationBar widget with three buttons labeled 'Home', 'Favorites', and 'Profile', respectively. The _selectedIndex variable is used to keep track of the currently selected button, and the _onItemTapped function is called when a button is tapped.

Attributes