MacMenuBarPlatform class abstract
The interface that implementations of mac_menu_bar must implement.
Platform-specific implementations should extend this class instead of directly
extending PlatformInterface to ensure they are using the correct platform
interface for functionality that depends on the platform's implementation.
- Inheritance
-
- Object
- PlatformInterface
- MacMenuBarPlatform
- Implementers
Constructors
- MacMenuBarPlatform()
- Constructs a MacMenuBarPlatform.
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.
- Adds a submenu to the specified parent menu.
-
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.
-
setMenuItemEnabled(
String itemId, bool enabled) → Future< bool> - Sets a menu item's enabled state.
-
setMenuItemSelectedHandler(
MenuItemSelectedHandler handler) → void - Sets the callback handler for custom menu item selections.
-
setOnCopyFromMenu(
Future< bool> callback()?) → void - Sets the callback that will be invoked when the Copy menu item is selected.
-
setOnCutFromMenu(
Future< bool> callback()?) → void - Sets the callback that will be invoked when the Cut menu item is selected.
-
setOnPasteFromMenu(
Future< bool> callback()?) → void - Sets the callback that will be invoked when the Paste menu item is selected.
-
setOnSelectAllFromMenu(
Future< bool> callback()?) → void - Sets the callback that will be invoked when the Select All menu item is selected.
-
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.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ MacMenuBarPlatform
-
Returns the current platform instance.
getter/setter pair