enterText()

tap()

drag()

In many cases, user interactions update the state of the app. In the test
environment, Flutter doesn’t automatically rebuild widgets when the state
changes. To ensure that the widget tree is rebuilt after simulating a user
interaction, call the pump() or pumpAndSettle()
methods provided by the WidgetTester.
This recipe uses the following steps:

Create a widget to test.

Enter text in the text field.

Ensure tapping a button adds the todo.

Ensure swipe-to-dismiss removes the todo.

1. Create a widget to test

For this example,
create a basic todo app that tests three features:

Entering text into a TextField.

Tapping a FloatingActionButton to add the text to a list of todos.