Open In App

Flutter Development in Ubuntu 20.04

Last Updated : 30 Aug, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, let’s look at how you can set up a development environment for Flutter, if you’re using Ubuntu 20.04. It was difficult earlier and was kind of a nightmare to get it done. But now, it has changed and anyone can easily set up a flutter development environment on their Ubuntu system in a few minutes. 

flutter developement in ubuntu

Flutter on Ubuntu

Let’s break down the things that we have to do. Before moving any further, please make a note that, we will be setting up flutter in VS Code since it allows a much smoother performance on almost any system (even if your system is having 4GB of Ram or low). I personally have experienced the advantage of using VS Code, where I got my overall time taken for various tasks reduced nearly by 75% when compared to the time taken while using Android Studio. The process involved in the setting up process are :

1) Downloading VS Code

VS Code or Visual Studio Code is an amazing all-in-one code editor developed by the team at Microsoft. It is free and open-sourced. You can download VS Code from here. It doesn’t have much download size and is easy to set up. 

You can also use the terminal to install the VS Code on your system, by running the following code : 

$ sudo apt install code

2) Downloading Flutter SDK

After installing VS Code, we need to install Flutter SDK so that it will enable VS Code to build flutter applications. In order to install the flutter SDK, you have to open your terminal again and run the following line of code (or follow similar instructions from the Flutter Website : 

$ sudo apt install code

Once you’re done installing the VS Code and Flutter SDK, let’s try opening VS Code. If there hadn’t been any installation errors, VS Code will open without any issue. After loading up, we need to enable Git which is a version control system (VCS) which will be really helpful in the later stages. 

For this, select VCS Option from the left side of the VS Code. Please refer to the below image if you’re new to VS Code. 

VCS option

VCS in VS Code

After selecting that, you will find an option to install Git. Once you click on that, you will be taken to the website from which you can download Git for your system. You can also install Git by running the following code on your terminal.

$ sudo apt update

$ sudo apt install git

After Installing Git, come back to the VS Code and select the Extensions (the icon present at two down the position with that of VCS).

installing git

Extension Shortcut

From that, you have to search for flutter and install that extension. Also, make sure that Dart is also installed in the same method. 

flutter plugin

Installing Flutter Extension

Now you’re nearly ready to go. There is one more final installation that you need to perform before you’re all set to go. You will have to install Android Studio for all the essential packages like ADB Manager or if you need to add any virtual devices via AVD Manager. 

4) Installing Android Studio

As said above, though we may be able to download all the packages separately, it may lead on to some errors. To avoid that, let’s install Android Studio so that all the essential packages will get added correctly. You can install Android Studio by running the following command on the terminal. 

First install JDK  : 

$ sudo apt install openjdk-11-jdk

Now, you can install Android Studio  :

$ sudo snap install android-studio --classic

After installing Android Studio, open it from the Applications directory and run it. You will be asked whether to import any settings and select ‘Do not import’ for that. Move ahead with the installation flow and finally, all the installation will be over. After the installation is over, you will reach the starting page. From there select the ‘Configure’ option present on the right side bottom.

configure android studio

Configure option

Now, you have to select ‘SDK Manager’ from the list and you will be redirected to a page where you can install the required Android SDKs for various Android OS Versions. Please make sure that you’re installing the SDK of the same version as that of your phone or the virtual device which you will be setting up later. Select them and click on ‘Apply’. After that, you will be prompted to install them and follow the procedure.

select android version

Select the required SDKs

 

Once everything is complete, close everything including Android Studio as well as VS Code. You can restart VS Code now. Within VS Code, you can create a new workspace folder (where your project files will be stored). After that, click on View from the top Tool Bar and select the Command Panel. 

In that type in Flutter New Project and select it. If everything has been set up correctly, you will be asked to type in your project name. Sometimes, you will be asked to locate the Flutter SDK. In that case, provide the location where you installed the Flutter SDK.

If there were no errors, a project of the name that you provided will load up in a moment. The same can also be achieved by running the following command on the terminal present on VS Code (select Terminal from the toolbar on the top and run the following command. 

flutter create $projectname 

where $projectname can be changed with the name of your preference. Once the project loads completely, all the files can be accessed from the Files section of VS Code present on the left side tool bar (2 positions above that of the VCS).

You may connect your physical device (android) for installing the application or you may install a new Android Virtual Device from the AVD Manager, just like how we installed the SDKs from SDK Manager. The Run option can be found just below VCS and it can be used to run and debug your application. 

Now, you’re all set to develop flutter application using VS Code. Happy Coding. 


Previous Article
Next Article

Similar Reads

Is Flutter Worth Learning? Top 7 Reasons to Learn Flutter
In today's era, the usage of smartphones has increased exponentially and so has the use of mobile applications and websites. Meanwhile, considering future career prospects, learning web development and mobile app development is strongly recommended for all individuals. And when we come to mobile app development, there are two most-popular open-sour
5 min read
Flutter - Sharing Data Among Flutter Pages
In this article, we are going to find the solution for the problem statement "Import/send data from one page to another in flutter". Before going into the topic, there are some pre-requisites. Pre-requisites:Basics of dart programming language.Setting up Flutter in VS code or Setting up Flutter in Android Studio.Creating first flutter app | Hello W
4 min read
Flutter Quill - Rich Text Editor in Flutter Application
This post will explain how to integrate a rich text editor into your Flutter application so that it may enable rich text editing. There are many more things we can do with Flutter Quill, but they can get a little involved. The example below is a pretty basic demonstration of what we mean. Let's first discuss what flutter quill is and why we need it
5 min read
Flutter - Animated AlertDialog in Flutter
Animating an AlertDialog in Flutter involves using the Flutter animations framework to create custom animations for showing and hiding the dialogue. In this article, we are going to add an animation to an AlertDialog. A sample video is given below to get an idea about what we are going to do in this article. [video mp4="https://media.geeksforgeeks.
4 min read
Flutter - Different Types of Loading using Flutter EasyLoading
Flutter applications involve incorporating loading indicators to provide users with feedback during background operations. Flutter has a package for simplifying the process named flutter_easyloading package. This package easiest way to integrate loading indicators with various styles. In this article, we will implement different types of loading in
5 min read
Android Studio Setup for Flutter Development
This article will show how to set up Android Studio to run Flutter Applications. Android Studio is one of the popular IDE( integrated development environment ) developed by Google itself to create cross-platform android applications. First, you have to install Android Studio of version 3.0 or later, as it offers an integrated IDE experience for a F
3 min read
Flutter - Setup for Web Development
As we know, the Flutter is growing day by day and become more powerful in just a small-time span. Initially, the flutter SDK released for Mobile App Development. But, now it is not limited to Mobile Apps, It also is available for Web and Desktop Application. Today, We learn how to make your first Web App using Flutter. Switching Flutter to the web
3 min read
Flutter - Best Alternatives for App Development
If you are a beginner and want to make some mobile apps, but you are confused about the technologies and frameworks for mobile app development offers, or if you are just curious to know what advantages flutter offers from its competitors then this article is for you. There are tons of options that a developer gets about the best trends and technolo
9 min read
Best Visual Studio Code Extensions for Productive Flutter Development
As a developer, we want productive tools and extensions to improve productivity and efficiency in the workspace. Here is a list of Visual Studio Code extensions that will help flutter developers to increase their productivity and bring more fun to development. It doesn't matter whether you are new to development or work as professional these extens
5 min read
Top 10 Flutter Tools for App Development in 2024
In the rapidly changing landscape of mobile application development, Flutter has appeared as a powerful framework for building cross-platform applications (Android, iOS, Web, and Desktop). With its rich set of features and a growing community, Flutter has empowered developers to create high-performance applications across various platforms, includi
9 min read
Article Tags :