Is runApp() method necessary to create a flutter app?
272
Yes, it's necessary. In dart only execute code inside the main method. Not like JavaScript or Python. It's like java/c. The only execution is the main method.
Author by
Ganesh
Updated on December 26, 2022Comments
-
Ganesh over 1 year
I expected this code to paint a black colored rectangle to screen but it didn't .I'm using flutter framework and I want to know that don't flutter support making apps like these or any mistake in my code. I just wanted to make run flutter code without built-in flutter framework library
}
-
Shubham Narkhede over 3 yearsyes is necessary runApp() method to create app
-
dm_tr over 3 yearsYour
main()
method must containrunApp(MyApp())
.MyApp
must be a Stateful or Stateless widget which must return aMaterialApp
Widget -
pskink over 3 yearsno,
runApp
is not necessary, check github.com/flutter/flutter/tree/…, it shows 4 different layers, try 2 first:raw
andrendering
-
Ganesh over 3 yearsThanks the link cleared my doubt
-
pskink over 3 yearssure, your welcome
-