SystemContextMenuController class

Allows access to the system context menu.

The context menu is the menu that appears, for example, when doing text selection. Flutter typically draws this menu itself, but this class deals with the platform-rendered context menu.

Only one instance can be visible at a time. Calling show while the system context menu is already visible will hide it and show it again at the new Rect. An instance that is hidden is informed via onSystemHide.

Currently this system context menu is bound to text input. The buttons that are shown and the actions they perform are dependent on the currently active TextInputConnection. Using this without an active TextInputConnection is a noop.

Call dispose when no longer needed.

See also:

Mixed in types

Constructors

SystemContextMenuController({VoidCallback? onSystemHide})
Creates an instance of SystemContextMenuController.

Properties

hashCode int
The hash code for this object.
no setterinherited
onSystemHide VoidCallback?
Called when the system has hidden the context menu.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Used to release resources when this instance will never be used again.
handleSystemHide() → void
Handles the system hiding a context menu.
override
hide() Future<void>
Hides this system context menu.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
show(Rect targetRect) Future<void>
Shows the system context menu anchored on the given Rect.
toString() String
A string representation of this object.
override

Operators

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