Flutter Installation Guide

Overview

This guide will help you set up Flutter on your development machine, enabling you to build cross-platform applications efficiently. Follow these steps to install Flutter and prepare your development environment.


Prerequisites

Before installing Flutter, ensure you have the following prerequisites:

  • Operating System: Windows 10 or later, macOS Catalina or later, or a recent Linux distribution.
  • Hardware: Minimum 8 GB of RAM and 10 GB of free storage space.
  • Development Tools: Choose and install an IDE (Visual Studio Code or Android Studio).

Step-by-Step Installation

1. Download Flutter SDK

  1. Visit the Flutter website: Go to the Flutter SDK download page.
  2. Select your OS: Choose the appropriate installation link for your operating system (Windows, macOS, or Linux).
  3. Download the SDK:
    • Windows: Download the flutter_windows_<version>-stable.zip file.
    • macOS: Download the flutter_macos_<version>-stable.zip file.
    • Linux: Download the flutter_linux_<version>-stable.tar.xz file.

2. Extract the SDK

  • Windows:

    1. Extract the downloaded .zip file to a desired location (e.g., C:\src\flutter).
    2. Add Flutter to your PATH:
      • Right-click on This PC or Computer on the desktop or in File Explorer.
      • Click on Properties -> Advanced system settings.
      • Click on Environment Variables.
      • In the System variables section, find the Path variable and click Edit.
      • Add the full path to the flutter/bin directory (e.g., C:\src\flutter\bin).
  • macOS/Linux:

    1. Open a terminal and navigate to the location where you want to install Flutter.
    2. Extract the downloaded file using the following command:
      • macOS: unzip ~/Downloads/flutter_macos_<version>-stable.zip
      • Linux: tar xf ~/Downloads/flutter_linux_<version>-stable.tar.xz
    3. Add Flutter to your PATH:
      • Open (or create) the .bash_profile, .bashrc, or .zshrc file in your home directory:
        nano ~/.bash_profile
      • Add the following line to the file:
        export PATH="$PATH:`<path-to-flutter-directory>`/flutter/bin"
      • Save the file and run:
        source ~/.bash_profile

3. Run Flutter Doctor

  1. Open a terminal or command prompt.
  2. Run the following command to check for any missing dependencies:
    flutter doctor
  3. Follow any additional instructions provided by flutter doctor to complete the setup. This may include installing additional tools like Android Studio or Xcode.

4. Install IDE and Plugins

  • Visual Studio Code:

    1. Download and install Visual Studio Code.
    2. Open VS Code and go to Extensions (Ctrl+Shift+X).
    3. Search for and install the Flutter and Dart plugins.
  • Android Studio:

    1. Download and install Android Studio.
    2. Open Android Studio and go to Preferences (macOS) or Settings (Windows/Linux).
    3. Navigate to Plugins and search for and install the Flutter and Dart plugins.
    4. Follow the setup wizard to install the Android SDK and other necessary components.

5. Set Up an Emulator

  • Android Emulator:

    1. Open Android Studio and go to AVD Manager (Android Virtual Device).
    2. Create a new virtual device and select the desired hardware profile.
    3. Choose a system image (e.g., Android 11) and follow the prompts to complete the setup.
  • iOS Simulator (macOS only):

    1. Open Xcode and go to Xcode -> Preferences -> Components.
    2. Download the required simulator versions.
    3. Use the Simulator app to run iOS simulators.

Verifying Installation

  1. Open a terminal or command prompt.
  2. Run the following command to ensure Flutter is installed correctly:
    flutter --version
  3. Run the following command to verify that all dependencies are correctly installed:
    flutter doctor

If all checks are passed, your Flutter environment is ready for development.