Add support for iOS UndoManager (#98294)

Add support for iOS UndoManager
This commit is contained in:
Jami Couch
2023-03-08 13:45:49 -06:00
committed by GitHub
parent a16e620ec2
commit 2a67bf78f0
14 changed files with 1429 additions and 347 deletions

View File

@@ -370,4 +370,16 @@ class TestTextInput {
Future<void> handleKeyUpEvent(LogicalKeyboardKey key) async {
await _keyHandler?.handleKeyUpEvent(key);
}
/// Simulates iOS responding to an undo or redo gesture or button.
Future<void> handleKeyboardUndo(String direction) async {
assert(isRegistered);
await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.handlePlatformMessage(
SystemChannels.textInput.name,
SystemChannels.textInput.codec.encodeMethodCall(
MethodCall('TextInputClient.handleUndo', <dynamic>[direction]),
),
(ByteData? data) {/* response from framework is discarded */},
);
}
}