Mock dependencies using Mockito

Find widgets

An introduction to widget testing

Cookbook

Testing

Widget

Introduction

1. Add the flutter_test dependency

2. Create a widget to test

3. Create a testWidgets test

4. Build the widget using the WidgetTester

Notes about the pump() methods

5. Search for our widget using a Finder

6. Verify the widget using a Matcher

Additional Matchers

Complete example

In the introduction to unit testing recipe,
you learned how to test Dart classes using the test package.
To test widget classes, you need a few additional tools provided by the
flutter_test package, which ships with the Flutter SDK.

The flutter_test package provides the following tools for
testing widgets: