IPadOSPlatformMenuDelegate class
Custom PlatformMenuDelegate adding support for menus on iOS, specifically for the new iPadOS 26 menu bar.
Use IPadOSPlatformMenuDelegate.create to instantiate this delegate. The factory method ensures proper platform validation and automatically falls back to DefaultPlatformMenuDelegate on non-iOS platforms.
Example:
WidgetsBinding.instance.platformMenuDelegate = IPadOSPlatformMenuDelegate.create();
- Inheritance
-
- Object
- PlatformMenuDelegate
- IPadOSPlatformMenuDelegate
Properties
- channel → MethodChannel
-
Method channel used to communicate menu data with the native iPadOS side.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearMenus(
) → void -
Removes all menus by setting an empty top-level menu list.
override
-
debugLockDelegate(
BuildContext context) → bool -
Locks the delegate to a single
contextduring debugging to detect conflicting menu owners.override -
debugUnlockDelegate(
BuildContext context) → bool -
Releases the debug lock previously acquired for
context.override -
getAvailableDefaultMenus(
) → Future< Map< String, String> ?> -
Queries the native side for the default menus available on the current
platform, returning
nullif the query fails. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setMenus(
List< PlatformMenuItem> topLevelMenus) → void -
Serializes
topLevelMenusand sends them to the native side, splitting them into default (IPadMenu) and custom menus.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
{MethodChannel? channel}) → PlatformMenuDelegate - Creates an instance of IPadOSPlatformMenuDelegate for iOS platforms, or DefaultPlatformMenuDelegate for other platforms.