build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Builds the ButtonBar widget, constructing a Bar with embedded tabs.

This method creates a Bar container configured without a back button, housing a Row of IconTab widgets. Each tab is wrapped in a Pylon that injects the _IsSelectedBottomIndex based on the selectedIndex, enabling reactive rendering. The tabs are evenly spaced for balanced layout, and unique keys ensure stable widget identities during state changes. This build process respects ArcaneTheme for overall styling, making it suitable for bottom navigation in responsive Arcane applications.

Returns a complete Bar widget ready for placement in a Scaffold's bottomNavigationBar slot.

Implementation

@override
Widget build(BuildContext context) => Bar(
      backButton: BarBackButtonMode.never,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: buttons
            .mapIndexed((button, index) => Pylon<_IsSelectedBottomIndex>(
                  value: _IsSelectedBottomIndex(index == selectedIndex),
                  builder: (context) => button,
                  key: ValueKey("$index.${button.icon}.$index"),
                ))
            .toList(),
      ),
    );