Home > Net >  Why the test folder automatically gets created on flutter projects, inside this folder the file widg
Why the test folder automatically gets created on flutter projects, inside this folder the file widg

Time:02-23

It comes all of my Flutter Projects. Is the folder necessary or not ? Do I delete the folder ?

enter image description here

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());

  • Related