Hit the the enter/done/return button in Flutter integration test after enter a text

Viewed 329
await tester.enterText(mySearchField, 'my search text');
await tester.showKeyboard(mySearchField);
await tester.sendKeyDownEvent(LogicalKeyboardKey.enter);

// do something to wait for 2 seconds
await tester.pumpAndSettle();
await Future.delayed(const Duration(seconds: 10), () {});

I'am trying to hit the done/enter/submit button on the virtual keyboard after enter a text in a search field..

how to do that, and how to wait for the result (async request)...

1 Answers
await simulateKeyDownEvent(LogicalKeyboardKey.accept);
Related