> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/NormandoRamirezDelgado/6C-Febrero-2026/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup Your Dart Development Environment

> Install the Dart SDK and configure your development environment to start writing Dart programs

## Overview

Before you can start writing Dart code, you need to set up your development environment. This guide will walk you through installing the Dart SDK and choosing an editor for writing your programs.

<Note>
  The setup process typically takes 10-15 minutes. Once complete, you'll be able to run all the examples in this course on your own computer.
</Note>

## Installing the Dart SDK

The Dart SDK includes everything you need to run Dart programs: the Dart VM, core libraries, and command-line tools.

<Tabs>
  <Tab title="Windows">
    ### Using Chocolatey (Recommended)

    If you have [Chocolatey](https://chocolatey.org/) installed:

    ```bash theme={null}
    choco install dart-sdk
    ```

    ### Manual Installation

    <Steps>
      <Step title="Download the SDK">
        Visit the [Dart SDK download page](https://dart.dev/get-dart) and download the Windows installer.
      </Step>

      <Step title="Run the installer">
        Execute the downloaded `.exe` file and follow the installation wizard.
      </Step>

      <Step title="Add to PATH">
        The installer should automatically add Dart to your PATH. If not, add the Dart SDK `bin` directory manually:

        ```
        C:\tools\dart-sdk\bin
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="macOS">
    ### Using Homebrew (Recommended)

    If you have [Homebrew](https://brew.sh/) installed:

    ```bash theme={null}
    brew tap dart-lang/dart
    brew install dart
    ```

    ### Manual Installation

    <Steps>
      <Step title="Download the SDK">
        Visit the [Dart SDK download page](https://dart.dev/get-dart) and download the macOS package.
      </Step>

      <Step title="Extract the archive">
        ```bash theme={null}
        unzip ~/Downloads/dartsdk-macos-x64-release.zip
        ```
      </Step>

      <Step title="Add to PATH">
        Add the Dart SDK to your PATH by editing `~/.zshrc` or `~/.bash_profile`:

        ```bash theme={null}
        export PATH="$PATH:/path/to/dart-sdk/bin"
        ```

        Then reload your shell configuration:

        ```bash theme={null}
        source ~/.zshrc
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="Linux">
    ### Using apt-get (Debian/Ubuntu)

    ```bash theme={null}
    sudo apt-get update
    sudo apt-get install apt-transport-https
    wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor -o /usr/share/keyrings/dart.gpg
    echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list
    sudo apt-get update
    sudo apt-get install dart
    ```

    ### Manual Installation

    <Steps>
      <Step title="Download the SDK">
        Visit the [Dart SDK download page](https://dart.dev/get-dart) and download the Linux package.
      </Step>

      <Step title="Extract the archive">
        ```bash theme={null}
        unzip ~/Downloads/dartsdk-linux-x64-release.zip
        ```
      </Step>

      <Step title="Add to PATH">
        Add the Dart SDK to your PATH by editing `~/.bashrc` or `~/.zshrc`:

        ```bash theme={null}
        export PATH="$PATH:/path/to/dart-sdk/bin"
        ```

        Then reload your shell configuration:

        ```bash theme={null}
        source ~/.bashrc
        ```
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Verify Installation

After installing the Dart SDK, verify that it's working correctly:

<Steps>
  <Step title="Open a terminal">
    Open a new terminal or command prompt window (this ensures PATH changes are loaded).
  </Step>

  <Step title="Check Dart version">
    Run the following command:

    ```bash theme={null}
    dart --version
    ```

    You should see output similar to:

    ```
    Dart SDK version: 3.2.0 (stable)
    ```
  </Step>
</Steps>

<Warning>
  If you see "command not found" or "'dart' is not recognized", the Dart SDK is not in your PATH. Revisit the installation steps and ensure the `bin` directory is correctly added to your PATH environment variable.
</Warning>

## Choose Your Editor

You can write Dart code in any text editor, but these editors provide the best experience with syntax highlighting, code completion, and debugging:

### Visual Studio Code (Recommended)

<Card title="VS Code" icon="code" href="https://code.visualstudio.com/">
  Free, lightweight, and powerful editor with excellent Dart support
</Card>

**Setup VS Code for Dart:**

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

  <Step title="Install Dart extension">
    1. Open VS Code
    2. Click the Extensions icon in the sidebar (or press `Ctrl+Shift+X` / `Cmd+Shift+X`)
    3. Search for "Dart"
    4. Click **Install** on the official Dart extension by Dart Code
  </Step>

  <Step title="Verify setup">
    Create a new file called `test.dart` and start typing. You should see syntax highlighting and code suggestions.
  </Step>
</Steps>

<Tip>
  **VS Code Tips:**

  * Use `F5` to run your Dart programs with debugging
  * Type `main` and press Tab for a code snippet
  * Hover over any Dart function to see its documentation
</Tip>

### IntelliJ IDEA / Android Studio

<Card title="IntelliJ IDEA" icon="laptop-code" href="https://www.jetbrains.com/idea/">
  Professional IDE with powerful refactoring and debugging tools
</Card>

**Setup IntelliJ/Android Studio:**

<Steps>
  <Step title="Install IDE">
    Download and install [IntelliJ IDEA](https://www.jetbrains.com/idea/) (Community Edition is free) or [Android Studio](https://developer.android.com/studio).
  </Step>

  <Step title="Install Dart plugin">
    1. Open IntelliJ/Android Studio
    2. Go to **Settings/Preferences** → **Plugins**
    3. Search for "Dart"
    4. Click **Install**
  </Step>

  <Step title="Configure Dart SDK">
    1. Go to **Settings/Preferences** → **Languages & Frameworks** → **Dart**
    2. Check **Enable Dart support**
    3. Set the Dart SDK path (e.g., `C:\tools\dart-sdk` or `/usr/lib/dart`)
  </Step>
</Steps>

### Other Editors

Dart also works with:

* **Sublime Text** - Install the Dart syntax package
* **Vim/Neovim** - Use the `dart-vim-plugin`
* **Emacs** - Use `dart-mode`
* **Any text editor** - Just save files with `.dart` extension

## Create Your First Program

Let's verify everything is working by creating and running your first Dart program:

<Steps>
  <Step title="Create a project directory">
    ```bash theme={null}
    mkdir dart-course
    cd dart-course
    ```
  </Step>

  <Step title="Create a Dart file">
    Create a new file called `hello.dart` with the following content:

    ```dart theme={null}
    void main() {
      print('Hola!!!');
    }
    ```
  </Step>

  <Step title="Run the program">
    Execute your program using the Dart command:

    ```bash theme={null}
    dart hello.dart
    ```

    You should see:

    ```
    Hola!!!
    ```
  </Step>
</Steps>

<Note>
  Congratulations! You've successfully set up your Dart development environment and run your first program.
</Note>

## Understanding the Dart Command

The `dart` command is your main tool for working with Dart programs:

```bash theme={null}
# Run a Dart program
dart filename.dart

# Run a Dart program with arguments
dart filename.dart arg1 arg2

# Format Dart code (makes it pretty)
dart format filename.dart

# Analyze code for issues
dart analyze

# Compile to executable
dart compile exe filename.dart
```

<Tip>
  **Pro Tip**: Use `dart format` regularly to keep your code consistently formatted. This is especially helpful when working on team projects.
</Tip>

## Troubleshooting Common Issues

<AccordionGroup>
  <Accordion title="'dart' command not found">
    **Problem**: The terminal doesn't recognize the `dart` command.

    **Solution**:

    1. Ensure you've installed the Dart SDK correctly
    2. Verify the Dart SDK `bin` directory is in your PATH
    3. Close and reopen your terminal to reload environment variables
    4. Try running with the full path: `/path/to/dart-sdk/bin/dart`
  </Accordion>

  <Accordion title="Permission denied on Linux/macOS">
    **Problem**: Cannot execute Dart programs due to permission errors.

    **Solution**:
    Make the Dart executable accessible:

    ```bash theme={null}
    chmod +x /path/to/dart-sdk/bin/dart
    ```
  </Accordion>

  <Accordion title="Editor doesn't recognize Dart syntax">
    **Problem**: No syntax highlighting or code completion in your editor.

    **Solution**:

    1. Ensure you've installed the Dart extension/plugin for your editor
    2. Verify the file has a `.dart` extension
    3. Restart your editor after installing extensions
    4. Check that the Dart SDK path is configured correctly in editor settings
  </Accordion>

  <Accordion title="Programs run but show errors">
    **Problem**: Dart programs execute but show warnings or errors.

    **Solution**:
    Run `dart analyze` to see detailed error messages:

    ```bash theme={null}
    dart analyze filename.dart
    ```

    This will show you exactly what's wrong and where.
  </Accordion>
</AccordionGroup>

## Development Workflow

Now that your environment is set up, here's the typical workflow you'll use:

<Steps>
  <Step title="Write code">
    Create or edit `.dart` files in your chosen editor.
  </Step>

  <Step title="Save frequently">
    Save your work often (most editors auto-save).
  </Step>

  <Step title="Run your program">
    Execute with `dart filename.dart` in the terminal.
  </Step>

  <Step title="Check for errors">
    Read any error messages carefully - they tell you exactly what's wrong.
  </Step>

  <Step title="Iterate">
    Fix errors, add features, and re-run until your program works as expected.
  </Step>
</Steps>

## Next Steps

Your development environment is ready! Now you can start learning Dart:

<CardGroup cols={2}>
  <Card title="Hello World" icon="hand-wave" href="/fundamentals/hello-world">
    Write your first Dart program and understand its structure
  </Card>

  <Card title="Variables" icon="cube" href="/fundamentals/variables">
    Learn how to store and work with data in Dart
  </Card>
</CardGroup>

<Tip>
  **Ready to Code?** Keep your terminal and editor side-by-side. Write code in the editor, run it in the terminal, and see results immediately. This fast feedback loop is key to learning effectively!
</Tip>
