How to get started with Flutter?

Roses are Red, Violets are Blue. I love Flutter, Why don’t you?

How to get started with flutter?
How to get started with flutter?

Content:

1.What is Flutter?
2. How to Install Flutter?
3. Connect Android Studio
4. Common Errors

So let’s get started!

What is Flutter?

Flutter is a free, open-source cross-platform development tool for building android, ios, web and embedded device apps using a single code base with great designs, smooth animations, and high performance.

Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, desktop, and embedded devices from a single codebase.
-flutter.dev

The first version of Flutter was known as codename “Sky” and ran on the Android operating system. It was unveiled at the 2015 Dart developer summit
-wikipedia

At the time of writing this article, Flutter 2.2 is released with some amazing changes compared to the previous versions. A few of the examples are null safety and stable web support.

Applications developed in flutter are eBay, Reflectly, Google Ads, Dream11 and many more.
-flutter.dev/showcase

You can always read about Flutter and changelog from its official website. flutter.dev.
Let’s move on to how to install flutter.

Quick note: If you face any error while installing any of the below applications, please look at the Common Errors section at the end of blog.

How to install Flutter?

First, go to this link and select your operating system. For this blog, I’ll cover Windows OS installation.

Official website for downloading Flutter.
Download Flutter

Please make sure to see the system requirements before proceeding to install.

System Requirements
System Requirements

Download the zip file and extract it on C:\src\

Warning: Do not install Flutter in a directory like C:\Program Files\ that requires elevated privileges.

Now it’s time to update the path.

Click on the search icon on the taskbar, type ‘env’, and open ‘Edit the system environment variables.

Environment variables
Environment variables

Open ‘Environment Variables’

System Properties
System Properties

Add path flutter\bin to the path variables

Update path
Update path

Well done. You’ve installed flutter successfully.

To check whether Flutter is installed correctly run the following command in the command prompt.

You will see the “unable to android sdk” error and to solve that, we need to install android studio.

Unable to locate Android SDK
Unable to locate Android SDK

Let’s download and install Android Studio now.

Connect Android Studio

Download Android Studio from this link.

Official website for downloading android studio
Android Studio

Install the android-studio.exe file with the default configuration.

It’ll take some time to launch for the first time. You’ll see the screen attached below. Go to “Configure”.

Android Studio Initial Page
Android Studio Initial Page

Click on “Plugins”.

Plugins
Plugins

Search for flutter, install the plugin and restart IDE.

Plugins
Plugins

After restarting, you’ll see the “Create New Flutter Project” option as well.

Create New Flutter Project is visible in the initial page.
Create New Flutter Project

Agree to Android Licenses

Android Licenses
Android Licenses

Before you can use Flutter, you must agree to the licenses of the Android SDK platform. This step should be done after you have installed the tools listed above.

Make sure that you have a version of Java 8 installed and that your JAVA_HOME environment variable is set to the JDK’s folder.

Android Studio versions 2.2 and higher come with a JDK, so this should already be done.

Open an elevated console window and run the following command to begin signing licenses.

flutter doctor --android-licenses

Review the terms of each license carefully before agreeing to them. Once you are done agreeing with licenses, run flutter doctor again to confirm that you are ready to use Flutter.

Run “flutter doctor” for the last time and you probably won’t see any errors. If incase you still get any errors refer the Common Errors section.

Now let’s start with out first flutter project. 😄

Click on “Create New Flutter Project”

Creating New Flutter Project
Creating New Flutter Project

Add your Flutter SDK path.

Adding Flutter SDK path
Adding Flutter SDK path

Next, name your project, select project location and give description to the project

Project Description
Project Description

Clicking on finish will create your first flutter project.🥳

Flutter Demo Code
Flutter Demo Code

Common Errors

Error 1:

Android Studio is installed but is not showing connected after running
flutter doctor

Error: Android studio not connected
Error: Android studio not connected

Solution:

Run flutter doctor to confirm that Flutter has located your installation of Android Studio. If Flutter cannot locate it, run flutter config --android-studio-dir <directory> to set the directory that Android Studio is installed to.

Make sure to paste the directory path in double quotes.

Image showing solution to android studio not connected bug.

Error 2:

No JDK found.

Error: No JDK found
Error: No JDK found

Solution:

Download the Java SE Development Kit from this link and add the path to system variables.

Screenshot of environment variables including jdk’s path

Error 3:

Error while accepting android licenses.

Error: Android licenses bug
Error: Android licenses bug

Solution:

Goto Android Studio/Settings/Android SDK/SDK Tools and install Android SDK Command-line Tools.

SDK tools of android studio

I hope this blog helped you to get started with flutter. Next, I’ll be writing more about Flutter and Dart in detail i.e. explaining demo code in my upcoming blog.

If you liked my content and also want to be a part of a great developer community, you can join my discord server. 😇

Link to Discord server: https://discord.gg/CX3HJZNPeU 🚀🚀🚀

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store