Flutter GNU/Linux Setup

Flutter GNU/Linux Setup

This is a guide for setting up Flutter into GNU/Linux.

Download

  1. Create a folder to keep the source code of Futter and Android Studio

    mkdir ~/.development
    cd .development
    
  2. Clone Flutter Source Code.

    git clone https://github.com/flutter/flutter.git -b stable
    
  3. Download and extract Android Studio from here into this folder.

    • It can be downloaded from FlatHub:
    flatpak install flathub com.google.AndroidStudio
    
  4. Add the flutter tool to your path

    export PATH="$PATH:/home/<username>/.development/flutter/bin"
    

    and then restart your shell or terminal.

Configuration

  1. Download Dart SDK via

    flutter precache
    
  2. Open Android Studio and download essential tools required for Android SDK

  3. Add Android SDK Path into Flutter

    flutter config --android-sdk /home/<username>/Android/Sdk
    

    you can find the SDK location in the SDK Manager settings inside Android Studio.

  4. Remove Flutter Analytics and Web support.

    flutter config --no-analytics --no-enable-web
    
  5. Accept android licenses via

    flutter config --android-licenses
    

Error Test

Now to check configurations run flutter doctor

The output will be something like this

code.png

Taking about the warning (& errors, if any)

  • Android Studio (not installed): You can specify the Andoird Studio Directory if you by simple typing (optional)
    flutter config --android-studio-dir <path of android studio>
    
  • [!] Connected device ! No devices available : This is showing because you don't have an emulator running. Which is completely normal.