Menubar constructor

const Menubar({
  1. Key? key,
  2. Offset? popoverOffset,
  3. bool border = true,
  4. required List<MenuItem> children,
})

Creates a Menubar with horizontal menu layout.

Configures a horizontal menubar that displays menu items and supports dropdown submenus with customizable styling and positioning.

Parameters:

  • key (Key?): Widget identifier for the widget tree
  • children (List
  • popoverOffset (Offset?, optional): Positioning offset for dropdown menus
  • border (bool, default: true): Whether to show a border around the menubar

Example:

Menubar(
  border: true,
  popoverOffset: Offset(0, 8),
  children: [
    MenuItem(
      title: Text('View'),
      children: [
        MenuItem(title: Text('Zoom In')),
        MenuItem(title: Text('Zoom Out')),
        MenuDivider(),
        MenuItem(title: Text('Full Screen')),
      ],
    ),
    MenuItem(
      title: Text('Tools'),
      children: [
        MenuItem(title: Text('Preferences')),
        MenuItem(title: Text('Extensions')),
      ],
    ),
  ],
)

Implementation

const Menubar({
  super.key,
  this.popoverOffset,
  this.border = true,
  required this.children,
});