PlatformMenu class Null safety
A class for representing menu items that have child submenus.
See also:
- PlatformMenuItem, a class representing a leaf menu item in a PlatformMenuBar.
- Inheritance
- Mixed in types
Constructors
- PlatformMenu({required String label, VoidCallback? onOpen, VoidCallback? onClose, )
-
Creates a const PlatformMenu.
const
Properties
-
descendants
→ List<
MenuItem> -
Returns all descendant
MenuItem
s of this item.read-onlyoverride - hashCode → int
-
The hash code for this object.
read-onlyinherited
- label → String
-
The label that will appear on the menu.
final
-
members
→ List<
MenuItem> -
Returns the list of group members if this menu item is a "grouping" menu
item, such as PlatformMenuItemGroup.
read-onlyinherited
-
The menu items in the submenu opened by this menu item.
final
- onClose → VoidCallback?
-
The callback that is called when this menu is closed.
final
- onOpen → VoidCallback?
-
The callback that is called when this menu is opened.
final
- 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-onlyinherited
- onSelectedIntent → Intent?
-
Returns an intent, if any, to be invoked if the platform receives a
"Menu.selectedCallback" method call from the platform for this item.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- shortcut → MenuSerializableShortcut?
-
The optional shortcut that selects this MenuItem.
read-onlyinherited
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 non-existent 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}) → 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< MenuItem> - 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.