Flutter Course: 2.2 Setting Up the Development Environment

Flutter is an open-source UI software development kit (SDK) for developing mobile applications. In this course, we will cover how to set up the development environment for Flutter 2.2. With Flutter, you can easily develop native applications that support both Android and iOS simultaneously.

1. What is Flutter?

Flutter is a UI toolkit developed by Google that allows you to create applications that run on various platforms with a single codebase. Flutter focuses on providing fast performance, beautiful UI, and a personalized user experience.

2. Preparing the Development Environment

To start Flutter development, you need to install several software and tools. Let’s build the development environment following the steps below.

2.1. System Requirements

  • Windows: Windows 7 SP1 or a higher version
  • macOS: macOS (64-bit)
  • Linux: Ubuntu 18.04 or higher

2.2. Downloading Flutter SDK

Flutter SDK can be downloaded from the official website. Here’s how to download it.

  1. Visit the Flutter official website (flutter.dev).
  2. Select “Get started” from the top menu.
  3. Download the SDK appropriate for your operating system.

2.3. Setting SDK Environment Variables

This step involves extracting the downloaded SDK and adding the SDK path to the environment variables (e.g., C:\flutter). The method for adding environment variables varies by operating system, so follow the guide below.

Windows

  1. Go to Control Panel > System and Security > System > Advanced system settings.
  2. Click on Environment Variables, select the “Path” variable, and click “Edit.”
  3. Add the Flutter SDK’s bin directory (C:\flutter\bin) as a new entry.

macOS / Linux

Add the environment variable to ~/.bash_profile or ~/.bashrc file using the following command.

export PATH="$PATH:`/flutter/bin`"

Then apply the file with the command below.

source ~/.bash_profile or source ~/.bashrc

2.4. Verifying Flutter Installation

Once the environment variables are set, open a terminal (CMD or PowerShell on Windows) and enter the following command to check if the installation was successful.

flutter doctor

This command checks the status of your Flutter installation and requirements, and advises on other software needed for the development environment.

2.5. Installing Additional Software

Additional software is required for Flutter to support multiple platforms. You will complete the environment for mobile application development by installing Android Studio and Xcode.

Installing Android Studio

  1. Download the software from the official Android Studio website.
  2. After installation, add the “Flutter” and “Dart” plugins.
  3. Also, set up the Android emulator and Android SDK.

Installing Xcode (macOS only)

  1. Download and install Xcode from the Mac App Store.
  2. Install the Command Line Tools using the command (xcode-select --install).

3. Creating Your First Flutter Project

Now that all environments are set up, it’s time to create your first Flutter project. Use the following command in the terminal to create a new project.

flutter create my_first_app

Executing this command will create a new folder called my_first_app, which contains the basic Flutter project template. Next, navigate to the project directory.

cd my_first_app

3.1. Running the Project

To run the basic Flutter project, connect an emulator or a real device and enter the following command.

flutter run

Executing this command will compile the app using Flutter and run it on the emulator or connected device.

4. Conclusion

In this course, we learned how to set up the Flutter 2.2 development environment. Flutter is a great tool for cross-platform application development, and if you have set up the development environment through this course, you are now ready to develop various applications.

Continue to learn about Flutter’s various features and start creating your projects. Future courses will cover the basics of Flutter and how to use various widgets to build UIs.