sendTextInputAction method

Future<void> sendTextInputAction(
  1. TextInputAction action, {
  2. Duration? timeout,
})

Simulate the user posting a text input action.

The available action types can be found in TextInputAction. The sendTextInputAction does not check whether the TextInputAction performed is acceptable based on the client arguments of the text input.

This can be called even if the TestTextInput has not been TestTextInput.registered.

Example:

link
test('submit text in a text field', () async {
  final SerializableFinder textField = find.byValueKey('enter-text-field');
  await driver.tap(textField);  // acquire focus
  await driver.enterText('Hello!');  // enter text
  await driver.waitFor(find.text('Hello!'));  // verify text appears on UI
  await driver.sendTextInputAction(TextInputAction.done);  // submit text
});

Implementation

Future<void> sendTextInputAction(TextInputAction action,
    {Duration? timeout}) async {
  await sendCommand(SendTextInputAction(action, timeout: timeout));
}