0

In flutter integration test, we generally enter the text by

await tester.enterText(find.byKey(ValueKey(key)), value);

But can anybody help me in clearing the entered text?

Jagadeesh
  • 358
  • 5
  • 17

1 Answers1

1

According to documentation:

Give the text input widget specified by finder the focus and replace its content with text...

https://api.flutter.dev/flutter/flutter_test/WidgetTester/enterText.html

you should be able to clear input text with:

await tester.enterText(find.byKey(ValueKey(key)), '');