pub struct UndoManager { /* private fields */ }Expand description
A low-level interface to the system’s undo manager.
To receive events from the system undo manager, create an
UndoManagerClient and set it as the client on UndoManager.
The set_undo_state method can be used to update the system’s undo
manager using the can_undo and can_redo parameters.
When the system undo or redo button is tapped, the current
UndoManagerClient will receive UndoManagerClient::handle_platform_undo
with an UndoDirection representing whether the event is “undo” or “redo”.
Currently, only iOS has an UndoManagerPlugin implemented on the engine side. On iOS, this can be used to listen to the keyboard undo/redo buttons and the undo/redo gestures.
See also:
Dart’s UndoManager._instance is instance, the App’s singleton.
Implementations§
Source§impl UndoManager
impl UndoManager
Sourcepub fn instance(app: &mut App) -> Handle<UndoManager>
pub fn instance(app: &mut App) -> Handle<UndoManager>
Dart’s UndoManager._instance.
Sourcepub fn set_client(app: &mut App, client: Option<AnyUndoManagerClient>)
pub fn set_client(app: &mut App, client: Option<AnyUndoManagerClient>)
Receive undo and redo events from the system’s UndoManager.
Setting the client will cause UndoManagerClient::handle_platform_undo
to be called when a system undo or redo is triggered, such as by tapping
the undo/redo keyboard buttons or using the 3-finger swipe gestures.
Sourcepub fn client(app: &mut App) -> Option<AnyUndoManagerClient>
pub fn client(app: &mut App) -> Option<AnyUndoManagerClient>
Return the current UndoManagerClient.
Sourcepub fn set_undo_state(_app: &mut App, _can_undo: bool, _can_redo: bool)
pub fn set_undo_state(_app: &mut App, _can_undo: bool, _can_redo: bool)
Set the current state of the system UndoManager. [can_undo] and [can_redo]
control the respective “undo” and “redo” buttons of the system UndoManager.
Empty: there is no method channel.
Sourcepub fn handle_platform_undo(app: &mut App, direction: UndoDirection)
pub fn handle_platform_undo(app: &mut App, direction: UndoDirection)
Flutter UndoManagerClient.handleUndo: the host asked for undo or redo.