buildBottomNavigationBar method

Widget buildBottomNavigationBar(
  1. BuildContext context,
  2. int index
)

Builds a BottomNavigationBar-style navigation for mobile layouts.

Renders NavTab items as tappable icons with labels, using ButtonBar for selection state. Integrates with ArcaneTheme for styling and supports disabled states for the active tab. Efficient for touch-based navigation, pairing with IndexedStack to avoid content recreation during switches.

Implementation

Widget buildBottomNavigationBar(BuildContext context, int index) => ButtonBar(
    selectedIndex: index,
    buttons: tabs
        .whereType<NavTab>()
        .mapIndexed((tab, barIndex) => IconTab(
              icon: tab.icon,
              selectedIcon: tab.selectedIcon ?? tab.icon,
              label: tab.label,
              onPressed:
                  index == barIndex ? null : () => _onChanged(barIndex),
            ))
        .toList());