MenuItem class Null safety

An abstract class for describing cascading menu hierarchies that are part of a PlatformMenuBar.

This type is used by PlatformMenuDelegate.setMenus to accept the menu hierarchy to be sent to the platform, and by PlatformMenuBar to define the menu hierarchy.

See also:

  • PlatformMenuBar, a widget that renders menu items using platform APIs instead of Flutter.
Mixed in types
Implementers

Constructors

Allows subclasses to have const constructors.
const

Properties

descendants List<MenuItem>
Returns all descendant MenuItems of this item. [...]
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
onClose VoidCallback?
Returns a callback, if any, to be invoked if the platform menu receives a "Menu.opened" method call from the platform for this item. [...]
read-only
onOpen VoidCallback?
Returns a callback, if any, to be invoked if the platform menu receives a "Menu.opened" method call from the platform for this item. [...]
read-only
onSelected VoidCallback?
Returns a callback, if any, to be invoked if the platform menu receives a "Menu.selectedCallback" method call from the platform for this item. [...]
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
@mustCallSuper, @protected, inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toChannelRepresentation(PlatformMenuDelegate delegate, {required int index, required int count, required MenuItemSerializableIdGenerator getId}) Iterable<Map<String, Object?>>
Converts the representation of this item into a map suitable for sending over the default "flutter/menu" channel used by DefaultPlatformMenuDelegate. [...]
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep. [...]
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object. [...]
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited