What is the difference between “main()” and “runApp()” functions in Flutter?

Technology CommunityCategory: FlutterWhat is the difference between “main()” and “runApp()” functions in Flutter?
VietMX Staff asked 3 years ago
  • 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.
  • runApp() function should return Widget that would be attached to the screen as a root of the Widget Tree that will be rendered.