MacMenuBarNoop class
No-op implementation of MacMenuBarPlatform for non-macOS platforms.
All methods are safe to call but do nothing. This allows consumers to
import and call MacMenuBar APIs on any platform without conditional
imports, while the actual native integration only activates on macOS.
- Inheritance
-
- Object
- PlatformInterface
- MacMenuBarPlatform
- MacMenuBarNoop
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addMenuItem(
{required String itemId, required String title, int? index, SingleActivator? shortcut, bool enabled = true}) → Future< bool> -
Adds a menu item to the specified menu.
override
-
Adds a submenu to the specified parent menu.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeMenuItem(
String itemId) → Future< bool> -
Removes a menu item by its ID.
override
-
setMenuItemEnabled(
String itemId, bool enabled) → Future< bool> -
Sets a menu item's enabled state.
override
-
setMenuItemSelectedHandler(
MenuItemSelectedHandler handler) → void -
Sets the callback handler for custom menu item selections.
override
-
setOnCopyFromMenu(
Future< bool> callback()?) → void -
Sets the callback that will be invoked when the Copy menu item is selected.
override
-
setOnCutFromMenu(
Future< bool> callback()?) → void -
Sets the callback that will be invoked when the Cut menu item is selected.
override
-
setOnPasteFromMenu(
Future< bool> callback()?) → void -
Sets the callback that will be invoked when the Paste menu item is selected.
override
-
setOnSelectAllFromMenu(
Future< bool> callback()?) → void -
Sets the callback that will be invoked when the Select All menu item is selected.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
updateMenuItem(
{required String itemId, String? title, bool? enabled}) → Future< bool> -
Updates a menu item's properties.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
registerWith(
) → void - Registers this no-op implementation as the platform instance.