2. Find a widget with a specific Key

In some cases, you might want to find a widget based on the Key that has been
provided to it. This can be handy if displaying multiple instances of the
same widget. For example, a ListView might display several
Text widgets that contain the same text.

In this case, provide a Key to each widget in the list. This allows
an app to uniquely identify a specific widget, making it easier to find
the widget in the test environment.

3. Find a specific widget instance

Finally, you might be interested in locating a specific instance of a widget.
For example, this can be useful when creating widgets that take a child
property and you want to ensure you’re rendering the child widget.

Summary

The find constant provided by the flutter_test package provides
several ways to locate widgets in the test environment. This recipe
demonstrated three of these methods, and several more methods exist
for different purposes.