MenuBarWidget constructor Null safety

const MenuBarWidget(
  1. {Key? key,
  2. required Widget child,
  3. required List<BarButton> barButtons,
  4. MenuStyle barStyle = const MenuStyle(),
  5. ButtonStyle barButtonStyle = const ButtonStyle(),
  6. ButtonStyle menuButtonStyle = const ButtonStyle(),
  7. bool enabled = true}
)

Hover over each field for more details.

Create the MenuBarWidget:

The following 2 fields are necessary: child and barButtons.

The MenuBarWidget contains a child, i.e. your application under the MenuBarWidget. For the barButtons field, implement a List of BarButton. The buttons in this List are displayed as the buttons on the bar.

Style the MenuBarWidget:

The bar itself: Implement your custom barStyle.

Bar buttons: Implement your custom barButtonStyle.

Menu and submenu buttons: Implement your custom menuButtonStyle.

Implementation

const MenuBarWidget({
  super.key,
  required this.child,
  required this.barButtons,
  this.barStyle = const MenuStyle(),
  this.barButtonStyle = const ButtonStyle(),
  this.menuButtonStyle = const ButtonStyle(),
  this.enabled = true,
});