pub struct SystemContextMenuController {
pub on_system_hide: Option<Listener>,
/* private fields */
}Expand description
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 on some platforms this class calls a platform method to show the system-drawn context menu instead.
There can only be one system context menu visible at a time. Calling [show] on one instance of this class while another instance is already shown will hide the old one.
Call [dispose] when no longer needed.
Fields§
§on_system_hide: Option<Listener>Called when the system has hidden the context menu.
Implementations§
Source§impl SystemContextMenuController
impl SystemContextMenuController
Sourcepub fn new(app: &mut App, on_system_hide: Option<Listener>) -> Handle<Self>
pub fn new(app: &mut App, on_system_hide: Option<Listener>) -> Handle<Self>
Creates an instance of SystemContextMenuController.
Not shown until show is called.
Sourcepub fn handle_system_hide(self: Handle<Self>, app: &mut App)
pub fn handle_system_hide(self: Handle<Self>, app: &mut App)
Called when the system has hidden the context menu.
Called when the user selects a custom menu item.
Sourcepub fn show(self: Handle<Self>, app: &mut App, target_rect: Rect)
👎Deprecated: Use show_with_items instead.
pub fn show(self: Handle<Self>, app: &mut App, target_rect: Rect)
Use show_with_items instead.
Shows the system context menu anchored on the given Rect.
Currently this system context menu is bound to text input. Using this
without an active TextInputConnection will be a noop.
Sourcepub fn show_with_items(
self: Handle<Self>,
app: &mut App,
target_rect: Rect,
items: Vec<IOSSystemContextMenuItemData>,
)
pub fn show_with_items( self: Handle<Self>, app: &mut App, target_rect: Rect, items: Vec<IOSSystemContextMenuItemData>, )
Shows the system context menu anchored on the given Rect with the given
buttons.
Sourcepub fn dispose(self: Handle<Self>, app: &mut App)
pub fn dispose(self: Handle<Self>, app: &mut App)
Used to release resources when this instance will never be used again.
Sourcepub fn dispatch_system_hide(app: &mut App)
pub fn dispatch_system_hide(app: &mut App)
Dispatch a system-hide from the host to the currently shown controller.
Sourcepub fn dispatch_custom_action(app: &mut App, callback_id: &str)
pub fn dispatch_custom_action(app: &mut App, callback_id: &str)
Dispatch a custom action from the host to the currently shown controller.