Skip to content

3. Setting Up the Development Environment

Now that you know the prerequisites, follow these steps to set up your development environment:

3.1 Installing Flutter

  1. Download Flutter SDK
  2. Extract the Flutter SDK
    • Extract the downloaded file to your desired installation directory (e.g., C:\flutter or ~/flutter).
    • Avoid locations like C:\Program Files to prevent permission issues.
  3. Add Flutter to Your PATH
    • Add the Flutter bin directory to your system's PATH variable:
      • Windows:
        • Open Environment Variables and add the path to flutter\bin.
      • macOS/Linux:
        • Add the following line to your shell configuration file (e.g., .bashrc, .zshrc):
          bash
          export PATH="$PATH:/path/to/flutter/bin"
  4. Verify Installation
    • Run the following command in your terminal:
      bash
      flutter doctor
    • Address any issues reported by the tool (e.g., missing dependencies, unconfigured Android SDK).

3.2 Configuring Android Studio

  1. Install Android Studio
    • Download and install Android Studio from the official website: Android Studio.
  2. Install Flutter and Dart Plugins
    • Open Android Studio and go to File > Settings > Plugins.
    • Search for "Flutter" and install it. The Dart plugin will be installed automatically.
  3. Configure Flutter and Dart SDK Paths
    • Go to File > Settings > Languages & Frameworks > Flutter.
    • Set the path to your Flutter SDK (e.g., C:\flutter or ~/flutter).
    • The Dart SDK path should be automatically detected as flutter/bin/cache/dart-sdk.
  4. Install Android SDK Tools
    • Open SDK Manager in Android Studio (Tools > SDK Manager).
    • Install the latest Command Line Tools and Build Tools.
    • Uncheck Hide Obsolete Packages and install Android SDK Command Line Tool (Latest).

3.3 Verifying Setup

After completing the above steps, verify that everything is configured correctly:

  1. Run the following command in your terminal:
    bash
    flutter doctor
  2. Ensure there are no critical errors. Common warnings include:
    • Missing licenses for Android SDK (run flutter doctor --android-licenses to accept them).
    • Missing emulator/device (set up an emulator or connect a physical device).

Released under the MIT License.