You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we create a flutter project, by default flutter create a test folder that contains widget_test.dart. Inside that, the pumpWidget method requires a widget to build our app and trigger a frame. It is not necessary but can be used for widget testing purposes. By default, it takes a widget named MyApp which is the first root widget that flutter creates for you. I assume that you might have removed the boilerplate code, which in turn removed that widget. You can either provide the name of the root widget(the widget given to the runApp method) as an argument to that method or create a widget named MyApp which is the root widget. You can also just ignore the warning or delete the folder widget_test.dart.
Activity
sdoshi983 commentedon Dec 7, 2020
The solution can be found out here
valen-developer commentedon Jan 10, 2021
Simply, import MyApp in your widget_test.dart.
JaiAravindh-git commentedon Feb 3, 2021
I would like to be assigned to this
Ritik609 commentedon Feb 26, 2021
Actually This is a warning. Better you should define a class MyApp and call this class under runApp.
Example:
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@OverRide
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
scaffoldBackgroundColor: Color(0xff1f1f1f),
primarySwatch: Colors.blue,
),
I think this may solve this warning.
01mahdivalipoor commentedon Apr 15, 2021
if you dont test your app, you can delete test folder for now.
Harikrishnan001 commentedon Jun 1, 2021
When we create a flutter project, by default flutter create a test folder that contains widget_test.dart. Inside that, the pumpWidget method requires a widget to build our app and trigger a frame. It is not necessary but can be used for widget testing purposes. By default, it takes a widget named MyApp which is the first root widget that flutter creates for you. I assume that you might have removed the boilerplate code, which in turn removed that widget. You can either provide the name of the root widget(the widget given to the runApp method) as an argument to that method or create a widget named MyApp which is the root widget. You can also just ignore the warning or delete the folder widget_test.dart.