Setting up Flutter as a Beginner

A Beginner-Friendly Guide for Windows, macOS, Linux, and Chrome OS

·

3 min read

Getting Started with Flutter

Flutter is an exciting framework that allows you to build beautiful cross-platform mobile applications. If you're new to Flutter, don't worry – setting it up is easier than you think! In this guide, we'll walk you through the installation process on Windows, macOS, Linux, and even Chrome OS. We'll cover both Android Studio, Visual Studio Code and even IntelliJ IDEA to make sure you have the tools you need to start coding.

Installing Android SDK

Installing Android Studio and its SDK is a crucial step for Flutter development. Below, I'll provide a beginner-friendly guide for installing Android Studio on Windows, macOS, and Linux.

  1. Download Android Studio:

  2. Install Android Studio

    1. When it comes to installing depending on the OS you are in instructions may differ as below.
  • For Windows, run the .exe installer.

  • For macOS, open the downloaded .dmg file and drag Android Studio to the "Applications" folder.

  • For Linux, extract and run the installer in the bin directory using ./studio.sh.

  • For chromeOS, just follow the Linux instructions after enabling Linux support on your Chromebook.

  1. Follow the wizard instructions for installing once the installer is running.

  2. Install Android Virtual Device (AVD) during setup.

  1. Launch Android Studio

    1. Configure Flutter in Android Studio by installing the Flutter and Dart plugins before restarting the IDE.

    2. Access the SDK Manager, click on "Configure" at the bottom right corner and select "SDK Manager."

    3. Install Command-Line Tools:

      • In the SDK Platforms tab, select "Show Package Details."

      • Look for "Android SDK Command-line Tools" and check the box.

      • Click "Apply" to install.

Installing Flutter SDK

To install the Flutter SDK, follow these general instructions. I'll specify any OS-specific steps where needed:

  1. Downloading and Extracting

    1. Download the Flutter SDK from the official website.

    2. Extract the ZIP file to a preffred location on your machine.

  2. Adding Flutter to the system Path variable

    For Windows:

    1. Press Win + S to open the search bar.

    2. Type "Environment Variables" and select "Edit the system environment variables" to open it.

    3. In the System Properties window, click the "Environment Variables..." button.

    4. In the Environment Variables window, under the "System variables" section, find and select the "Path" variable. Click "Edit."

    5. Click "New" and add the path to the Flutter bin directory (e.g., D:\Devs\flutter\bin).

    6. Click "OK" to close each window.

    7. Open a new Command Prompt or PowerShell window and run flutter --version to verify that Flutter is in the PATH.

macOS/Linux:

  1. Open a terminal window.

  2. Depending on your shell (bash, zsh, etc.), open the appropriate profile file. For example:

    • For bash: nano ~/.bashrc or nano ~/.bash_profile

    • For zsh: nano ~/.zshrc

  3. Add the following line at the end of the file to add Flutter to PATH:

    export PATH="$PATH:/home/sirodevs/flutter/bin"
  1. Replace /home/sirodevs/flutter with the actual path to your Flutter installation.

  2. Save the file (press Ctrl + X, then Y, then Enter in nano).

You could also run this on your terminal as a shortcut to avoid opening the nano editor

echo 'export PATH="$PATH:/home/sirodevs/flutter/bin"' >> ~/.bashrc
  1. Run source ~/.bashrc (or source ~/.zshrc) to apply the changes and reload the profile.

  2. Open a new terminal window and run flutter --version to verify that Flutter is in the PATH.

These instructions should help you add Flutter to the system PATH variable on your specific operating system. After completing these steps, you should be able to use Flutter commands from any directory in the terminal or command prompt.

user in plugdev group; are your udev rules wrong or error: insufficient permissions for device: udev requires plugdev group membership?

echo 'export ANDROID_SDK_ROOT="/home/sirodevs/Developer/Android/Sdk"' >> ~/.bashrc

This article is not finished yet, I will keep updating it and adjusting it as we go along.