ContextMenu class

Class that represents the WebView context menu. It used by PlatformWebViewCreationParams.contextMenu.

NOTE for Android native WebView: To make it work properly on Android, JavaScript should be enabled!

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS

Constructors

ContextMenu({List<ContextMenuItem> menuItems = const [], void onCreateContextMenu(InAppWebViewHitTestResult)?, void onHideContextMenu()?, @Deprecated("Use settings instead") ContextMenuOptions? options, ContextMenuSettings? settings, void onContextMenuActionItemClicked(ContextMenuItem)?})
NOTE for Android native WebView: To make it work properly on Android, JavaScript should be enabled!

Properties

hashCode int
The hash code for this object.
no setterinherited
List of the custom ContextMenuItem.
final
onContextMenuActionItemClicked → void Function(ContextMenuItem)?
Event fired when a context menu item has been clicked.
final
onCreateContextMenu → void Function(InAppWebViewHitTestResult)?
Event fired when the context menu for this WebView is being built.
final
onHideContextMenu → void Function()?
Event fired when the context menu for this WebView is being hidden.
final
options → ContextMenuOptions?
Use settings instead
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settings ContextMenuSettings?
Context menu settings.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts instance to a map.
toMap() Map<String, dynamic>
Converts instance to a map.
toString() String
A string representation of this object.
override

Operators

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

Static Methods

fromMap(Map<String, dynamic>? map) ContextMenu?
Gets a possible ContextMenu instance from a Map value.