MenuItem constructor

MenuItem({
  1. Key? key,
  2. Widget? leading,
  3. required Widget title,
  4. Widget? trailing,
  5. ShortcutActivator? shortcutActivator,
  6. Intent? intent,
  7. VoidCallback? onPressed,
  8. MenuItemStyle? style,
  9. bool? enabled,
  10. bool closeMenuOnAction = true,
  11. Widget? submenu,
})

For an item created with this constructor, shortcutActivator, if provided, is used to make an item's shortcut label.

Implementation

MenuItem({
  Key? key,
  Widget? leading,
  required Widget title,
  Widget? trailing,
  this.shortcutActivator,
  this.intent,
  this.onPressed,
  this.style,
  this.enabled,
  this.closeMenuOnAction = true,
  this.submenu
}) :
  tileDelegate = MenuItemTileDelegateForLTT(
    leading, title, trailing,
    shortcutActivator, submenu != null
  ),
  super(key: key) {
  assert(configurationIsCorrect());
}