Getting Started With Flutter

Getting Started With Flutter

1*73IgUxPfyXUKZAaIXgutrw.png

What is Flutter?

Flutter is an open-source UI development kit created by google. It is used in developing applications for Android, iOS, Windows, Mac, Linux, Google Fuchsia and the web.

This article will guide us through all the steps required to configure a flutter development environment for building cross-platform applications.

To install and run Flutter, your development environment must meet these minimum requirements.

Windows:

  • Operating Systems: Windows 7 SP1 or later (64-bit)
  • Disk Space: 400 MB (does not include disk space for IDE/tools).
  • Tools: Flutter depends on these tools being available in your environment.
    • Windows PowerShell 5.0 or newer (this is pre-installed with Windows 10)
    • Git for Windows 2.x, with the Use Git from the Windows Command Prompt option.

If Git for Windows is already installed, make sure you can run git commands from the command prompt or PowerShell.

Linux

  • Operating Systems: Linux (64-bit)
  • Disk Space: 600 MB (does not include disk space for IDE/tools).

Steps :

Download and Install flutter SDK

  • Extract the file in the desired location, for example:
$ cd ~
$ tar xf ~/Downloads/flutter_linux_v1.9.1+hotfix.6-stable.tar.xz
  • Add the flutter tool to your path
$ export PATH="$PATH:`pwd`/flutter/bin"

Add flutter tool permanently to path

Open '.bashrc' file located in the home directory and add the below line at the bottom.

$ export PATH="$PATH:[PATH_TO_USERS_FOLDER]/home/flutter/bin"

then run this command

$ source ~/.bashrc

Restart your terminal and run then you should be able to run the flutter command

Screenshot from 2019-11-19 16-56-38.png

Install android studio

To develop flutter applications you need to run a full installation of Android studio which installs Android SDK, Android SDK Platform-Tools, and Android SDK Build-Tools required for developing flutter applications

Setting up Visual Studio Code

To develop flutter applications you can use any code editor of your choice.

  • Visual Studio Code
  • Android Studio

To use visual studio code you need to install the dart and flutter extension which assists in linting and debugging dart code.

Screenshot from 2019-11-19 17-15-29.png

Creating your first flutter project

Now that everything is all good we can create a new flutter project with the below command which actually creates a starter app with some boilerplates.

$ flutter create project_name
$ cd project_name

We can now run the flutter project by connecting a device or using an emulator. Make sure you turn on USB debugging from developer settings if making use of a device.

$ flutter run