> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Braian551/viax/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Complete guide to installing Flutter, dependencies, and setting up your development environment for Viax

# Installation Guide

This guide will help you install all required tools and dependencies to develop and run the Viax platform.

## System Requirements

<Tabs>
  <Tab title="Windows">
    **Minimum:**

    * Windows 10 (64-bit) or later
    * 8 GB RAM (16 GB recommended)
    * 10 GB free disk space
    * Git for Windows

    **Recommended:**

    * Windows 11
    * 16 GB RAM
    * SSD storage
    * Administrator access
  </Tab>

  <Tab title="macOS">
    **Minimum:**

    * macOS 10.14 (Mojave) or later
    * 8 GB RAM (16 GB recommended)
    * 10 GB free disk space
    * Xcode (for iOS development)

    **Recommended:**

    * macOS 13 (Ventura) or later
    * 16 GB RAM
    * SSD storage
  </Tab>

  <Tab title="Linux">
    **Minimum:**

    * Ubuntu 20.04 LTS or equivalent
    * 8 GB RAM (16 GB recommended)
    * 10 GB free disk space

    **Recommended:**

    * Ubuntu 22.04 LTS
    * 16 GB RAM
    * SSD storage
  </Tab>
</Tabs>

***

## Step 1: Install Flutter SDK

### Download Flutter

<Steps>
  <Step title="Visit Flutter Website">
    Go to [flutter.dev](https://flutter.dev/docs/get-started/install)
  </Step>

  <Step title="Select Your OS">
    Choose your operating system (Windows, macOS, Linux)
  </Step>

  <Step title="Download SDK">
    Download the latest stable Flutter SDK (3.35.3 or higher)
  </Step>
</Steps>

### Install Flutter

<CodeGroup>
  ```bash Windows theme={null}
  # Extract to C:\src\flutter (or your preferred location)
  # Add to PATH:
  # Control Panel > System > Advanced > Environment Variables
  # Add: C:\src\flutter\bin

  # Verify installation
  flutter --version
  flutter doctor
  ```

  ```bash macOS theme={null}
  # Extract the archive
  cd ~/development
  unzip ~/Downloads/flutter_macos_3.35.3-stable.zip

  # Add to PATH in ~/.zshrc or ~/.bashrc
  export PATH="$PATH:$HOME/development/flutter/bin"

  # Apply changes
  source ~/.zshrc

  # Verify
  flutter --version
  flutter doctor
  ```

  ```bash Linux theme={null}
  # Extract the archive
  cd ~/development
  tar xf ~/Downloads/flutter_linux_3.35.3-stable.tar.xz

  # Add to PATH in ~/.bashrc
  export PATH="$PATH:$HOME/development/flutter/bin"

  # Apply changes
  source ~/.bashrc

  # Verify
  flutter --version
  flutter doctor
  ```
</CodeGroup>

### Run Flutter Doctor

```bash theme={null}
flutter doctor -v
```

This command checks your environment and displays a report. Fix any issues marked with \[!] or \[X].

**Expected Output:**

```
[✓] Flutter (Channel stable, 3.35.3)
[✓] Android toolchain - develop for Android devices
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.85)
[✓] Connected device (1 available)
[✓] Network resources
```

***

## Step 2: Install Android Development Tools

### Android Studio

<Steps>
  <Step title="Download Android Studio">
    Visit [developer.android.com/studio](https://developer.android.com/studio)
  </Step>

  <Step title="Install">
    Run the installer and follow the setup wizard
  </Step>

  <Step title="Install Android SDK">
    Android Studio will install:

    * Android SDK
    * Android SDK Platform-Tools
    * Android SDK Build-Tools
  </Step>

  <Step title="Configure Flutter Plugin">
    1. Open Android Studio
    2. Settings/Preferences > Plugins
    3. Search "Flutter"
    4. Install Flutter plugin (includes Dart)
    5. Restart Android Studio
  </Step>
</Steps>

### SDK Manager Configuration

<Tabs>
  <Tab title="Required SDK Platforms">
    In Android Studio > Tools > SDK Manager > SDK Platforms:

    Install:

    * ☑ Android 13.0 (API 33)
    * ☑ Android 12.0 (API 31)
    * ☑ Android 11.0 (API 30)
  </Tab>

  <Tab title="Required SDK Tools">
    In SDK Manager > SDK Tools:

    Install:

    * ☑ Android SDK Build-Tools
    * ☑ Android SDK Command-line Tools
    * ☑ Android Emulator
    * ☑ Android SDK Platform-Tools
    * ☑ Intel x86 Emulator Accelerator (HAXM)
  </Tab>
</Tabs>

### Accept Android Licenses

```bash theme={null}
flutter doctor --android-licenses
```

Press 'y' to accept all licenses.

***

## Step 3: iOS Development (macOS Only)

<Warning>
  iOS development is only available on macOS with Xcode installed.
</Warning>

### Install Xcode

<Steps>
  <Step title="Download Xcode">
    Open App Store and search for "Xcode"
  </Step>

  <Step title="Install">
    Download and install (this may take a while, \~15 GB)
  </Step>

  <Step title="Open Xcode">
    Launch Xcode to complete initial setup
  </Step>

  <Step title="Install Command Line Tools">
    ```bash theme={null}
    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    sudo xcodebuild -runFirstLaunch
    ```
  </Step>

  <Step title="Install CocoaPods">
    ```bash theme={null}
    sudo gem install cocoapods
    pod setup
    ```
  </Step>
</Steps>

### iOS Simulator

```bash theme={null}
# Open simulator
open -a Simulator

# List available simulators
flutter emulators

# Launch specific simulator
flutter emulators --launch apple_ios_simulator
```

***

## Step 4: Code Editor Setup

### VS Code (Recommended)

<Steps>
  <Step title="Install VS Code">
    Download from [code.visualstudio.com](https://code.visualstudio.com/)
  </Step>

  <Step title="Install Extensions">
    Required extensions:

    * **Flutter** (by Dart Code)
    * **Dart** (by Dart Code)

    Optional but recommended:

    * **Error Lens** (inline errors)
    * **Bracket Pair Colorizer** (code readability)
    * **GitLens** (Git integration)
    * **Material Icon Theme** (file icons)
  </Step>

  <Step title="Configure Settings">
    Open settings (Ctrl+, or Cmd+,) and set:

    ```json theme={null}
    {
      "editor.formatOnSave": true,
      "dart.flutterSdkPath": "C:\\src\\flutter",
      "dart.lineLength": 100,
      "editor.rulers": [80, 100],
      "files.autoSave": "afterDelay"
    }
    ```
  </Step>
</Steps>

### Android Studio (Alternative)

If you prefer Android Studio:

1. Ensure Flutter and Dart plugins are installed
2. File > Settings > Plugins > Install Flutter plugin
3. Restart Android Studio

***

## Step 5: Install Git

<Tabs>
  <Tab title="Windows">
    1. Download from [git-scm.com](https://git-scm.com/download/win)
    2. Run installer
    3. Use default settings or customize
    4. Verify:

    ```bash theme={null}
    git --version
    ```
  </Tab>

  <Tab title="macOS">
    ```bash theme={null}
    # Install via Homebrew
    brew install git

    # Or via Xcode Command Line Tools
    xcode-select --install

    # Verify
    git --version
    ```
  </Tab>

  <Tab title="Linux">
    ```bash theme={null}
    # Ubuntu/Debian
    sudo apt update
    sudo apt install git

    # Fedora
    sudo dnf install git

    # Verify
    git --version
    ```
  </Tab>
</Tabs>

### Configure Git

```bash theme={null}
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

# Verify configuration
git config --list
```

***

## Step 6: Clone Viax Repository

```bash theme={null}
# Clone the repository
git clone https://github.com/Braian551/viax.git

# Navigate to project
cd viax

# Check Flutter configuration
flutter doctor
```

***

## Step 7: Install Project Dependencies

### Flutter Dependencies

```bash theme={null}
# Install packages from pubspec.yaml
flutter pub get

# Verify dependencies
flutter pub outdated
```

**Key Dependencies Installed:**

<Tabs>
  <Tab title="State Management">
    ```yaml theme={null}
    provider: ^6.1.3
    flutter_bloc: ^9.1.1
    equatable: ^2.0.5
    ```
  </Tab>

  <Tab title="Networking">
    ```yaml theme={null}
    http: ^1.1.0
    dartz: ^0.10.1
    ```
  </Tab>

  <Tab title="Maps & Location">
    ```yaml theme={null}
    flutter_map: ^8.2.2
    latlong2: ^0.9.1
    geolocator: ^14.0.2
    geocoding: ^4.0.0
    ```
  </Tab>

  <Tab title="UI Components">
    ```yaml theme={null}
    shimmer: ^3.0.0
    pin_code_fields: ^8.0.1
    fl_chart: ^1.1.1
    image_picker: ^1.0.7
    ```
  </Tab>

  <Tab title="Utilities">
    ```yaml theme={null}
    shared_preferences: ^2.2.2
    intl: ^0.20.2
    uuid: ^4.2.1
    path_provider: ^2.1.3
    ```
  </Tab>
</Tabs>

***

## Step 8: Set Up Device/Emulator

### Android Emulator

<Steps>
  <Step title="Open AVD Manager">
    Android Studio > Tools > Device Manager
  </Step>

  <Step title="Create Virtual Device">
    * Click "Create Device"
    * Select phone (e.g., Pixel 7)
    * Choose system image (API 33 recommended)
    * Configure AVD settings
    * Click Finish
  </Step>

  <Step title="Launch Emulator">
    ```bash theme={null}
    flutter emulators
    flutter emulators --launch <emulator_id>
    ```
  </Step>
</Steps>

### Physical Device

<Tabs>
  <Tab title="Android Device">
    1. **Enable Developer Options:**
       * Settings > About Phone
       * Tap "Build Number" 7 times
    2. **Enable USB Debugging:**
       * Settings > Developer Options
       * Enable "USB Debugging"
    3. **Connect via USB:**
       * Connect phone to computer
       * Allow USB debugging on phone
       * Verify:
       ```bash theme={null}
       flutter devices
       adb devices
       ```
  </Tab>

  <Tab title="iOS Device">
    1. **Connect iPhone/iPad:**
       * Connect via USB
       * Trust this computer on device
    2. **Register Device:**
       * Open Xcode
       * Window > Devices and Simulators
       * Ensure device appears
    3. **Configure Signing:**
       * Open ios/Runner.xcworkspace in Xcode
       * Select Runner target
       * Signing & Capabilities
       * Select your team
    4. **Verify:**
       ```bash theme={null}
       flutter devices
       ```
  </Tab>
</Tabs>

***

## Step 9: Verify Installation

### Run Flutter Doctor

```bash theme={null}
flutter doctor -v
```

**All items should show \[✓]:**

```
[✓] Flutter (Channel stable, 3.35.3)
    • Flutter version 3.35.3
    • Framework revision xxx
    • Engine revision xxx
    • Dart version 3.8.0

[✓] Android toolchain - develop for Android devices
    • Android SDK version 33.0.0
    • Platform android-33, build-tools 33.0.0

[✓] Xcode - develop for iOS and macOS (macOS only)
    • Xcode version 15.0

[✓] Chrome - develop for the web

[✓] Android Studio (version 2023.1)
    • Flutter plugin version 77.1.1
    • Dart plugin version 231.8109.91

[✓] VS Code (version 1.85.0)
    • Flutter extension version 3.78.0

[✓] Connected device (2 available)
    • Pixel 7 (mobile) • emulator-5554
    • Chrome (web) • chrome

[✓] Network resources
```

### Test Run

```bash theme={null}
# Create test project
flutter create test_app
cd test_app

# Run on connected device
flutter run

# Should see:
# - App compiling
# - App installing on device
# - Flutter demo app launching
```

### Run Viax

```bash theme={null}
# Navigate to Viax project
cd path/to/viax

# Get dependencies
flutter pub get

# Run on device
flutter run

# Or specify device
flutter run -d <device-id>
```

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Flutter command not found">
    **Problem:** Terminal doesn't recognize `flutter` command

    **Solution:**

    1. Verify Flutter is in PATH:
       ```bash theme={null}
       echo $PATH  # macOS/Linux
       echo %PATH%  # Windows
       ```
    2. Add Flutter bin directory to PATH
    3. Restart terminal
    4. Try: `flutter --version`
  </Accordion>

  <Accordion title="Android licenses not accepted">
    **Problem:** `flutter doctor` shows Android licenses issue

    **Solution:**

    ```bash theme={null}
    flutter doctor --android-licenses
    # Press 'y' for all prompts
    ```
  </Accordion>

  <Accordion title="Xcode not configured (macOS)">
    **Problem:** Xcode command line tools not found

    **Solution:**

    ```bash theme={null}
    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    sudo xcodebuild -runFirstLaunch
    ```
  </Accordion>

  <Accordion title="Unable to locate Android SDK">
    **Problem:** Flutter can't find Android SDK

    **Solution:**

    1. Open Android Studio
    2. Tools > SDK Manager
    3. Note SDK location (e.g., `C:\Users\YourName\AppData\Local\Android\Sdk`)
    4. Set environment variable:
       ```bash theme={null}
       export ANDROID_SDK_ROOT=/path/to/sdk  # macOS/Linux
       set ANDROID_SDK_ROOT=C:\path\to\sdk  # Windows
       ```
  </Accordion>

  <Accordion title="Emulator won't start">
    **Problem:** Android Emulator fails to launch

    **Solution:**

    1. Enable virtualization in BIOS (Intel VT-x or AMD-V)
    2. Install HAXM:
       * SDK Manager > SDK Tools > Intel x86 Emulator Accelerator
    3. Try different system image (API 30 or 31)
    4. Increase emulator RAM in AVD settings
  </Accordion>

  <Accordion title="CocoaPods errors (iOS)">
    **Problem:** Pod install fails

    **Solution:**

    ```bash theme={null}
    # Update CocoaPods
    sudo gem install cocoapods

    # Clean and reinstall
    cd ios
    rm -rf Pods Podfile.lock
    pod install
    cd ..
    flutter clean
    flutter pub get
    ```
  </Accordion>
</AccordionGroup>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Environment Configuration" icon="gear" href="/setup/environment-configuration">
    Configure API URLs and environment variables
  </Card>

  <Card title="Local Development" icon="laptop-code" href="/setup/local-development">
    Set up local backend with Laragon
  </Card>

  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Get the app running quickly
  </Card>

  <Card title="Architecture" icon="diagram-project" href="/concepts/architecture">
    Understand the codebase structure
  </Card>
</CardGroup>

<Check>
  **Installation Complete!** You're now ready to develop and run Viax on your machine.
</Check>
