Find widgets

Tap, drag, and enter text

Handle scrolling

Cookbook

Testing

Widget

Handle scrolling

1. Create an app with a list of items

2. Write a test that scrolls through the list

3. Run the test

Many apps feature lists of content,
from email clients to music apps and beyond.
To verify that lists contain the expected content
using widget tests,
you need a way to scroll through lists to search for particular items.

To scroll through lists via integration tests,
use the methods provided by the WidgetTester class,
which is included in the flutter_test package:

In this recipe, learn how to scroll through a list of items to
verify a specific widget is being displayed, and discuss the pros on cons of
different approaches.

This recipe uses the following steps:

Create an app with a list of items.