# 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

   ```bash
   mkdir ~/.development
   cd .development
   ```

2. Clone Flutter Source Code.

   ```bash
   git clone https://github.com/flutter/flutter.git -b stable
   ```

3. Download and extract Android Studio from [here](https://developer.android.com/studio) into this folder.

   - It can be downloaded from FlatHub:

   ```bash
   flatpak install flathub com.google.AndroidStudio
   ```

4. Add the flutter tool to your path
   ```bash
   export PATH="$PATH:/home/<username>/.development/flutter/bin"
   ```
   and then restart your shell or terminal.

## Configuration

1. Download Dart SDK via

   ```bash
   flutter precache
   ```

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

3. Add Android SDK Path into Flutter

   ```bash
   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.

   ```bash
   flutter config --no-analytics --no-enable-web
   ```

5. Accept android licenses via
   ```bash
   flutter config --android-licenses
   ```

### Error Test

Now to check configurations run `flutter doctor`

The output will be something like this

![code.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636569664885/aNR0Dehov.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)*
```bash
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.
