onPressed property
Callback invoked when this menu item is pressed.
Called when the user taps or clicks on the menu item. This action is independent of content display - items with content can still have onPressed callbacks for additional behavior like navigation.
Implementation
final VoidCallback? onPressed;