Getting Started With Flutter – Beginner’s Guide

Getting started with Flutter

Since its release in December 2018, Flutter has gained traction and is rapidly becoming a popular choice for many professional mobile developers around the world. Most Android and iOS developers today are beginning to agree that this is a faster and more promising alternative to other cross-platform frameworks.

To get started with Flutter, you need to follow the instructions below.

System requirements

To install and run Flutter, you must meet the following minimum requirements:

1. Operating system: Windows 7 SP1 or later (64-bit)

2. Disk space: 400 MB (does not include disk space for IDE / tools).

3. Tools: Flutter depends on the availability of these tools.

  • Windows PowerShell 5.0 or later (pre-installed Windows 10)
  • Git for Windows 2. x with the Use Git option from the Windows command line.

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

Flutter SDK

Download the installation package to get the latest stable version of the Flutter SDK.

Extract the zip file and place the flutter it contains in the appropriate installation location for the Flutter SDK (for example, C: \ src \ flutter; do not install Flutter in a directory like C: \ Program Files\, which requires elevated privileges).

If you don’t want to install the fixed version, you can skip steps 1 and 2. Instead, get the source code from the Flutter repository on GitHub and change the tags if necessary. For example:

C:\src>git clone https://github.com/flutter/flutter.git -b stable

Now you are ready to run Flutter commands in the Flutter Console!

Update your path

If you want to run Flutter commands on a normal Windows console, follow these steps to add Flutter to the PATH environment variable:

  1. In the start search bar, type “env” and select “Edit environment variables for your account”.
  2. In the User variables section, check whether there is an entry named Path:
  • If the record exists, add the full path to flutter \ bin using; as a separator from existing values.
  • If the record does not exist, create a new custom variable named Path with the full path to the flutter \ bin value.

Note that you must close and reopen all existing console Windows for these changes to take effect.

Run flutter doctor

In the console window with the Flutter directory in the path, run the following command to see if there are platform dependencies required to complete the installation:

C:\src\flutter>flutter doctor

This command checks your environment and displays a report on the status of your Flutter installation. Carefully check the output for other software that you may need to install or other tasks that need to be completed.

For example:

[-] Android toolchain - develop for Android devices

• Android SDK at D:\Android\sdk                                                                                                                                ✗ Android SDK is missing command line tools; download from https://goo.gl/XxQghQ

• Try re-installing or updating your Android SDK,                                                                                                    visit https://flutter.dev/setup/#android-setup for detailed instructions.

The following sections describe how to complete these tasks and complete the installation process. After you have installed the missing dependencies, you can run the flutter doctor command again to make sure everything is configured correctly.

Android Configuration

Flutter relies on a full Android Studio installation to provide Android platform dependencies. However, you can write your Flutter apps in multiple editors.

 Install Android Studio

  1. Download and install Android Studio.
  2. Launch Android Studio and run the “Android Studio Setup Wizard”. This is where you install the latest versions of the Android SDK, the Android SDK command-line tools, and the Android SDK build tools that Flutter needs when developing for Android.

Configure your Android device

To prepare for launching and testing the Flutter app on an Android device, you will need a device running Android 4.1 (API level 16) or higher.

  1. Enable developer settings and USB debugging on your device. Detailed instructions are available in the Android documentation.
  2. Windows-only: install Google USB Driver.
  3. Use a USB cable to connect your phone to your computer. If a request appears on your device, authorize your computer to access your device.
  4. In the terminal, run the flutter devices command to make sure that Flutter recognizes the connected Android device. By default, Flutter uses the version of the Android SDK that your adb tool is based on. If you want Flutter to use a different installation of the Android SDK, you must set the ANDROID_HOME environment variable for this installation directory.

Configure the Android emulator

To prepare for launching and testing the Flutter app on the Android emulator, follow these steps:

  1. Enable virtual machine acceleration on your computer.
  2. Launch Android Studio > Tools > Android > AVD Manager and select Create Virtual Device.
  3. Select the device description and click Next.
  4. Select one or more system images for the Android versions you want to emulate and click Next. An x86 or x86_64 image is recommended.
  5. In the Emulated performance section, select Hardware-GLES 2.0 to enable hardware acceleration.
  6. Make sure that the AVD configuration is correct and select Done.
  7. In the Android virtual device Manager, click Run on the toolbar. The emulator starts and displays the default canvas for the selected OS version and device.

Web Configuration

Flutter has early support for creating web applications using the beta Flutter channel.


.

Recommended Articles

Share
Tweet
Pin
Share
Share