It imports flutter material package. It allows to create UI based on material design guideline specified by Android.
It is the main entry point of the flutter project. It calls the runApp method. Pass object of MyApp class which will be stateful or stateless widget.
Here, MyApp is a Stateless widget. Stateless widget is a widget which does not maintain any state of the widget.
MyApp class overrides the build method which is used to create UI. It returns MaterialApp which is the root Widget of the application UI. It has following properties:
title: It is title of application.
theme: It is theme of the application. It uses ThemeData to configure application theme.
primarySwatch: Its type is MaterialColor.
visualDensity: VisualDensity.adaptivePlatformDensity: This makes the visual density adapt to the platform that you run the app on. For desktop platforms, the controls will be smaller and closer together (more dense) than on mobile platforms.
home: It sets the inner UI of the application which is another widget MyHomePage.
MyHomePage is a Stateful widget which takes title as a parameter of constructor. It uses Scaffold, AppBar, Center, Text and many other widgets which we will learn in detail in further topics.