The below widget displays title and message. Add flutter_test dependency in pubspec. yaml file as shown below, if not exist. Create a new test file under the test folder for testing ‘MyWidget’; ‘testWidgets’ method allows to define widget test and creates ‘WidgetTester’ class to work with tests .
Read moreHow do you use the flutter test?
How to test a Flutter app
Read more