MenuButton constructor

const MenuButton({
  1. Key? key,
  2. required Widget child,
  3. List<MenuItem>? subMenu,
  4. ContextedCallback? onPressed,
  5. Widget? trailing,
  6. Widget? leading,
  7. bool enabled = true,
  8. FocusNode? focusNode,
  9. bool autoClose = true,
  10. OverlayController? overlayController,
})

Creates a menu button.

Parameters:

  • child (Widget, required): Main content
  • subMenu (List<MenuItem>?): Optional nested submenu
  • onPressed (ContextedCallback?): Click handler
  • trailing (Widget?): Trailing widget
  • leading (Widget?): Leading icon or widget
  • enabled (bool): Whether enabled, defaults to true
  • focusNode (FocusNode?): Focus node
  • autoClose (bool): Auto-close behavior, defaults to true
  • overlayController (OverlayController?): Optional popover controller

Implementation

const MenuButton({
  super.key,
  required this.child,
  this.subMenu,
  this.onPressed,
  this.trailing,
  this.leading,
  this.enabled = true,
  this.focusNode,
  this.autoClose = true,
  this.overlayController,
});