It comes all of my Flutter Projects. Is the folder necessary or not ? Do I delete the folder ?
CodePudding user response:
Basically runApp()
method(inside main.dart) contains a class and it should be same as defined in this tester.pumpWidget(....)
method. If they don't match, it causes this error.
e.g
In your main.dart if runApp() method is having a class HomePage
runApp(const HomePage());
then inside widget_test.dart file it should be like await tester.pumpWidget(const HomePage());
CodePudding user response:
Remove const
. like await tester.pumpWidget(MyApp());