Difference between main and runApp functions in Flutter

0 votes

Hi Guys,

I recently started with Flutter Framework. I don't know much about this. Can anyone tell me what is the difference between main() and runApp() functions in Flutter?

Jul 20, 2020 in Others by akhtar
• 38,260 points
9,455 views

2 answers to this question.

0 votes

Hi@akhtar,

The main() function came from Java-like languages so it's where all program started, without it, you can't write any program on Flutter even without UI.

The runApp() function should return widget that would be attached to the screen as a root of the widget Tree that will be rendered.

To know more about Flutter, join our Flutter APP Development Course today.

answered Jul 20, 2020 by MD
• 95,460 points
0 votes
main is entry point and,   runApp() is attached weight to screen
answered Apr 26, 2022 by anonymous

Related Questions In Others

+1 vote
1 answer

what is the difference between error and stderr in Node.js?

Error is an object created by Node.js to handle ...READ MORE

answered Jul 4, 2019 in Others by sunshine
• 1,300 points
2,450 views
0 votes
1 answer

What's the difference between struct and class in .NET?

In .NET, there are two categories of ...READ MORE

answered Feb 8, 2022 in Others by Soham
• 9,710 points
445 views
0 votes
1 answer

What is the difference between POST and PUT in HTTP?

To answer your question, both of them ...READ MORE

answered Feb 11, 2022 in Others by Rahul
• 9,680 points
790 views
0 votes
0 answers

What is the difference between iostream , stdio.h and conio.h header files in c++?

I am confused between all these three ...READ MORE

Sep 23, 2022 in Others by gaurav
• 23,260 points
1,537 views
0 votes
1 answer
0 votes
1 answer

What are some advantages of Flutter?

Hi@akhtar, Nowadays Flutter is taking the market. It ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,460 points
813 views
0 votes
1 answer

'git rev-parse HEAD' is not recognized as an internal or external command

Hi@akhtar, I also faced the same problem. You ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,460 points
4,159 views
+1 vote
2 answers

Flutter plugin not installed; this adds Flutter specific functionality.

Hatayı çözebildin mi? Bende de aynı hata ...READ MORE

answered Nov 21, 2020 in Others by Osman
21,109 views
0 votes
1 answer

How to pass functions to widgets in Flutter?

Hi@akhtar, Functions are first-class objects in Dart and ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,460 points
6,337 views
0 votes
1 answer

Difference between Hot Restart and Hot Reload?

Hi@akhtar, In simple Hot Reload with just update ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,460 points
2,654 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP