Menu class
- Implemented types
Constructors
- Menu.borrowed(int nativeHandle)
- Wraps a handle owned elsewhere; releasing it stays the owner's job.
- Menu.fromHandle(int nativeHandle)
- Adopts a handle returned by the C API and releases it when this object becomes unreachable.
Properties
-
allItems
→ List<
MenuItem> -
no setter
- backend → MenuBackend
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → int
-
no setter
- itemCount → int
-
no setter
- nativeHandle → int
-
The underlying handle-table entry.
final
-
nativeObject
→ Pointer<
Void> -
Platform-specific native object behind this handle.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addItem(
MenuItem? item) → void -
addListener(
FutureOr< void> callback(MenuEvent)) → ListenerId -
Registers
callbackfor everyMenuEventthisMenuemits. -
addSeparator(
) → void -
clear(
) → void -
close(
) → bool -
dispose(
) → void - Releases the handle now instead of at collection.
-
getItemAt(
int index) → MenuItem? -
getItemById(
MenuItemId itemId) → MenuItem? -
insertItem(
int index, MenuItem? item) → void -
insertSeparator(
int index) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
open(
PositioningStrategy strategy, Placement placement) → bool -
removeItem(
MenuItem? item) → bool -
removeItemAt(
int index) → bool -
removeItemById(
MenuItemId itemId) → bool -
removeListener(
ListenerId listenerId) → bool - Unregisters a listener. Returns false if unknown.
-
setBackend(
MenuBackend backend) → bool -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
) → Menu? -
Creates a new
Menu; returns null if the native side failed. -
createWithNativeMenu(
Pointer< Void> nativeMenu) → Menu? -
Creates a new
Menu; returns null if the native side failed. -
isBackendSupported(
MenuBackend backend) → bool