DefaultPlatformMenuDelegate class Null safety

The platform menu delegate that handles the built-in macOS platform menu generation using the 'flutter/menu' channel.

An instance of this class is set on WidgetsBinding.platformMenuDelegate by default when the WidgetsBinding is initialized.

See also:

  • PlatformMenuBar, the widget that adds a platform menu bar to an application.
  • PlatformMenu, the class that describes a menu item with children that appear in a cascading menu.
  • PlatformMenuItem, the class that describes the leaves of a menu hierarchy.
Inheritance

Constructors

DefaultPlatformMenuDelegate({MethodChannel? channel})
Creates a const DefaultPlatformMenuDelegate.

Properties

channel MethodChannel
Defines the channel that the DefaultPlatformMenuDelegate uses to communicate with the platform.
final
hashCode int
The hash code for this object.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

clearMenus() → void
Clears any existing platform-rendered menus and leaves the application with no menus.
override
debugLockDelegate(BuildContext context) bool
This is called by PlatformMenuBar when it is initialized, to be sure that only one is active at a time.
override
debugUnlockDelegate(BuildContext context) bool
This is called by PlatformMenuBar when it is disposed, so that another one can take over.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
setMenus(List<MenuItem> topLevelMenus) → void
Sets the entire menu hierarchy for a platform-rendered menu bar.
override
toString() String
A string representation of this object.
inherited

Operators

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