Flutter basics and a hello world app : Complete Flutter Tutorial

its time for you to learn the basics of coding with flutter. I will show you the basics of Flutter through a simple hello world app in Flutter

Now that you have a gone thorough introduction of Flutter, its time for you to learn the basics of coding with flutter. I will show you the basics of Flutter through a simple hello world app in Flutter. For that, you need to set up a development environment for Flutter. Setting up IDE for Flutter should be pretty easy. Just go with me step by step and you should have IDE up and running in no time.

Setting up IDE for Flutter


Flutter Tutorial: Flutter basics and a hello world app
We will be using Android studio for coding so go to Google's Official site for Android studio and download and install the latest version of Android studio. Just follow the standard procedure for installing and you will have the Android Studio installed in no time.
Flutter Tutorial: Flutter basics and a hello world app

After installation, when you open your Android studio for the first time, your Android studio will look somewhat like this. Click on the configure button and select Plugins.

Flutter Tutorial: Flutter basics and a hello world app

In Marketplace, search for Flutter and install it. It will prompt you to install the dart plugin. Click Yes. Now when prompted restart your Android studio. Once Android studio restarts, you should see Strat a new Flutter project in your menu. This confirms that Flutter has been successfully been installed.

Flutter Tutorial: Flutter basics and a hello world app

You will need to separately download Flutter SDK from the Flutter's Official Website and extract it in any location which you prefer. Just remember the location as Android studio will ask it afterward.

A Flutter Hello World App


Flutter Tutorial: Flutter basics and a hello world app

Start a new Flutter Project and select Flutter application. On the next screen enter the project name and give the path where you downloaded Flutter SDK. As soon as you enter the path, it will check if the SDK is up to date or not. Once done click Finish.

As soon as your Android studio starts, you will see a chunk of code in main.dart file. Clear all the code except the import statement.

Now add this code in its place.
[void main() {
  runApp(
  MaterialApp(
     home: Center(
         child: Text("Hello World"),
       ),
     ),
  );
}]

Run it and you will see hello word at the center of the screen. Now lets' break down the code little by little.

The first line, Void main() is a regular function like it is in Java. It is inside this function that you write your actual code. The line is a runApp function which gets called inside void main. Next inside is the MaterialApp(). It tells the Android that the app is material designed. 99.99 % of all the apps will run inside MaterialApp except for some times when you want the app in Cupertino style for iOS. Next is home, which sets the current screen as the default screen for coding. Next is the Centre widget which centers everything placed inside it. The child of the center widget is the text widget hello world, which will be put to the center of the screen by the center widget.

You can further modify the code by adding a widget Scaffold instead of center and then create a new container for the center widget. The scaffold is where you have elements like the title bar, bottom navigation bar, etc. Here is the code after adding the Scaffold

[void main() {
  runApp(
  MaterialApp(
     home: Scaffold(
        body : Container(
          child : Center(
             child : Text("Hello World"),
          )
        ),
     ),
  ),
  );
}]

Every widget you add has to be the child of some widget inside your app. So we add an attribute child before every widget.

This was a basic overview of Flutter. Tell us what you think about our tutorial in the comments. Once you finish this you can proceed to Working with images in Flutter

COMMENTS

BLOGGER
Name

Affiliate marketing tutorial,2,Android,60,Android Development,22,Android tutorials,41,Blogging tactics,8,Deals,1,DSA,4,Elite Youtube Tutorial,4,Firebase,1,Flutter,4,Fuchsia,1,Hosting Guides,3,Leetcode,4,Miscellaneous,10,Mobile Gaming,17,NTN,94,Problogging,7,PUBG,16,Reviews,1,SEO Tutorial,5,Start a blog,9,Start a channel,6,Top 5,4,Travel Blogging,4,Windows,12,Windows Security,4,Windows tutorials,7,Wordpress Tutorials,4,Youtube Tutorials,11,
ltr
item
A Passionate Developers Creation: Flutter basics and a hello world app : Complete Flutter Tutorial
Flutter basics and a hello world app : Complete Flutter Tutorial
its time for you to learn the basics of coding with flutter. I will show you the basics of Flutter through a simple hello world app in Flutter
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiJqAgCDOFyAHGdlhS7v16SaZi9zpguJb4Q-WRXExq6RbsGYLnCw1g92UN21RLVYEkzUc-O9RGeshAnfJlN-dsjCBSbfHgt5eDJrf7mq0G6ypPVU9nHF-4fLs0FOgL4mNliWm2Twv7w3k/s320/android-studio-logo.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiJqAgCDOFyAHGdlhS7v16SaZi9zpguJb4Q-WRXExq6RbsGYLnCw1g92UN21RLVYEkzUc-O9RGeshAnfJlN-dsjCBSbfHgt5eDJrf7mq0G6ypPVU9nHF-4fLs0FOgL4mNliWm2Twv7w3k/s72-c/android-studio-logo.png
A Passionate Developers Creation
https://www.apdevc.com/2020/02/flutter-tutorial-flutter-basics-and.html
https://www.apdevc.com/
https://www.apdevc.com/
https://www.apdevc.com/2020/02/flutter-tutorial-flutter-basics-and.html
true
3690156770086819421
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content