select method

void select(
  1. Event event,
  2. MenuItem item,
  3. MenuItemGroup group
)

Implementation

void select(Event event, MenuItem item, MenuItemGroup group) {
  //item.action?.call();
  item.actionWithContext?.call(event);

  // Fire the event for activating the menu item. This does not mean the item
  // is selected, but merely that it was triggered (by mouse, keyboard, w/e).
  _selected.add(item);

  // If the item is in a multi-select group, keep the menu open so the user
  // can select multiple items.
  if (group is! MenuItemGroupWithSelection ||
      group.shouldCloseMenuOnSelection) {
    _menuRoot.closeHierarchy();
  }
}