PlatformMenu class

A class for representing menu items that have child submenus.

See also:

Inheritance
Mixed-in types

Constructors

PlatformMenu({required String label, VoidCallback? onOpen, VoidCallback? onClose, required List<PlatformMenuItem> menus})
Creates a const PlatformMenu.
const

Properties

descendants List<PlatformMenuItem>
Returns all descendant PlatformMenuItems of this item.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
label String
The required label used for rendering the menu item.
finalinherited
members List<PlatformMenuItem>
Returns the list of group members if this menu item is a "grouping" menu item, such as PlatformMenuItemGroup.
no setterinherited
The menu items in the submenu opened by this menu item.
final
onClose VoidCallback?
Returns a callback, if any, to be invoked if the platform menu receives a "Menu.closed" method call from the platform for this item.
final
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.
final
onSelected VoidCallback?
An optional callback that is called when this PlatformMenuItem is selected.
finalinherited
onSelectedIntent Intent?
An optional intent that is invoked when this PlatformMenuItem is selected.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shortcut MenuSerializableShortcut?
The optional shortcut that selects this PlatformMenuItem.
finalinherited

Methods

debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
override
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toChannelRepresentation(PlatformMenuDelegate delegate, {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.
override
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
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the 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

Static Methods

getDescendants(PlatformMenu item) List<PlatformMenuItem>
Returns all descendants of the given item.
serialize(PlatformMenu item, PlatformMenuDelegate delegate, MenuItemSerializableIdGenerator getId) Map<String, Object?>
Converts the supplied object to the correct channel representation for the 'flutter/menu' channel.
override