Lesson 12 min

IDE Setup — VS Code & Android Studio

00:00 / 00:00

IDE Setup — VS Code & Android Studio

A great Integrated Development Environment (IDE) transforms coding from a chore into a pleasure. With the right setup, you get intelligent code completion, real-time error highlighting, integrated debugging, and one-click formatting. In this lesson, we'll configure VS Code and Android Studio for Dart development — plus introduce DartPad as a zero-installation alternative.


Option 1: VS Code (Recommended for Beginners)

Visual Studio Code is a lightweight, free, and highly extensible editor made by Microsoft. It's the most popular choice for Dart and Flutter developers.

Step 1 — Download and Install VS Code

  1. Go to https://code.visualstudio.com
  2. Download the installer for your OS (Windows / macOS / Linux)
  3. Run the installer and follow the prompts
  4. Launch VS Code when done

Step 2 — Install the Dart Extension

The Dart extension is the heart of your Dart development setup in VS Code.

  1. Open VS Code
  2. Press Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (macOS) to open Extensions
  3. Search for "Dart"
  4. Click Install on the extension by Dart Code (publisher: dart-code)

What the Dart extension gives you:

  • Syntax highlighting
  • IntelliSense (code completion)
  • Real-time error and warning indicators
  • Go to Definition / Find References
  • Integrated Dart DevTools
  • Debugging support
  • Code formatting via dart format

Step 3 — Install the Flutter Extension (Optional but Recommended)

Even if you're learning Dart before Flutter, the Flutter extension adds extra tooling that works well with Dart.

  1. In Extensions, search for "Flutter"
  2. Click Install on the extension by Dart Code

Tip: Installing Flutter extension also ensures the Dart extension is at its latest supported version.

Step 4 — Configure settings.json for Dart

VS Code's settings can be customized per-project or globally. Let's set up ideal Dart defaults.

Open the Command Palette with Ctrl+Shift+P (or Cmd+Shift+P), type "Open User Settings (JSON)", and add:

json
{ // Dart-specific settings "[dart]": { "editor.formatOnSave": true, "editor.formatOnType": true, "editor.rulers": [80], "editor.selectionHighlight": false, "editor.suggest.snippetsPreventQuickSuggestions": false, "editor.suggestSelection": "first", "editor.tabCompletion": "onlySnippets", "editor.wordBasedSuggestions": "off" }, // Dart SDK path (only needed if not auto-detected) // "dart.sdkPath": "C:/dart-sdk", // Show type annotations inline "dart.inlayHints": true, // Line length for dart format "dart.lineLength": 80, // Enable closing labels for widgets/constructors "dart.closingLabels": true, // Preview flutter outline in sidebar "dart.flutterOutline": true }

Essential VS Code Keyboard Shortcuts for Dart

ActionWindows/LinuxmacOS
Format documentShift+Alt+FShift+Option+F
Go to definitionF12F12
Find all referencesShift+F12Shift+F12
Rename symbolF2F2
Quick fix / code actionsCtrl+.Cmd+.
Toggle terminalCtrl+`Ctrl+`
Command PaletteCtrl+Shift+PCmd+Shift+P
Run without debugCtrl+F5Cmd+F5
Start debuggingF5F5

Step 5 — Verify VS Code Setup

Create a file called hello.dart and type:

dart
void main() { print('VS Code Dart setup is working!'); }

You should see:

  • Syntax highlighting (colorful code)
  • No red underlines (no errors)

Press F5 or open the terminal and run:

bash
dart run hello.dart

Option 2: Android Studio / IntelliJ IDEA

Android Studio (built on IntelliJ IDEA) is a full-featured IDE, especially powerful for Flutter and Android projects. If you plan to build mobile apps, this is a great choice.

Step 1 — Download Android Studio

  1. Go to https://developer.android.com/studio
  2. Download and install Android Studio for your OS
  3. Complete the initial setup wizard (you can skip Android SDK install for now if you're Dart-only)

Step 2 — Install the Dart Plugin

  1. Open Android Studio
  2. Go to File → Settings (Windows/Linux) or Android Studio → Preferences (macOS)
  3. Navigate to Plugins
  4. Search for "Dart"
  5. Click Install and restart Android Studio

Step 3 — Install the Flutter Plugin (Optional)

  1. In the same Plugins screen, search for "Flutter"
  2. Click Install
  3. Restart Android Studio

Note: The Flutter plugin automatically enables the Dart plugin as a dependency.

Step 4 — Configure Dart SDK in Android Studio

After installing the plugin:

  1. Go to File → Settings → Languages & Frameworks → Dart
  2. Check Enable Dart support for the project
  3. Set the Dart SDK path (e.g., C:\dart-sdk on Windows, /usr/lib/dart on Linux)
  4. Click Apply → OK

Android Studio Features for Dart

FeatureDescription
Smart completionContext-aware suggestions as you type
Parameter hintsShows parameter names inline
Refactoring toolsRename, extract method, introduce variable
Integrated debuggerBreakpoints, watch expressions, call stack
Dart AnalysisReal-time error and lint checking
Code formattingCtrl+Alt+L applies dart format
Structure viewSee all classes/methods in sidebar

Essential Android Studio Shortcuts

ActionWindows/LinuxmacOS
Format codeCtrl+Alt+LCmd+Option+L
Go to definitionCtrl+BCmd+B
Find usagesAlt+F7Option+F7
RenameShift+F6Shift+F6
Quick fixAlt+EnterOption+Enter
RunShift+F10Ctrl+R
DebugShift+F9Ctrl+D

Option 3: DartPad — No Installation Required

DartPad is an official online Dart editor from the Dart team. It runs entirely in your browser — no installation needed.

🌐 URL: https://dartpad.dev

What DartPad Offers

  • Run Dart code instantly in the browser
  • Test Flutter widgets with the Flutter toggle
  • Share code via URL with colleagues
  • Access built-in samples and tutorials
  • See console output, errors, and documentation

Limitations of DartPad

LimitationDetails
No file system accessCan't read/write files
No package importsOnly core Dart + some approved packages
Single file onlyCan't manage multi-file projects
Requires internetNo offline use
PerformanceSlightly slower than native

When to Use DartPad

  • Quickly testing a Dart snippet
  • Sharing code examples with others
  • Learning Dart without any setup
  • Experimenting with concepts

Recommended Extensions & Plugins Summary

VS Code Extensions

ExtensionPurposeInstall
DartCore Dart supportRequired
FlutterFlutter + enhanced DartHighly recommended
Error LensInline error messagesOptional
Bracket Pair ColorizerColor-matched bracketsOptional
GitLensGit history in editorOptional
Pubspec AssistEasy package.yaml managementOptional

Android Studio / IntelliJ Plugins

PluginPurpose
DartCore Dart language support
FlutterFlutter framework integration
Rainbow BracketsColor-coded bracket pairs
String ManipulationHandy string tools

Summary

In this lesson, you set up your Dart development environment with:

  • VS Code — Dart extension, Flutter extension, settings.json for format-on-save and line length, keyboard shortcuts
  • Android Studio — Dart plugin, Flutter plugin, SDK path configuration, and power-user shortcuts
  • DartPad — The zero-setup browser-based Dart editor for quick experiments

Recommendation: If you're just starting with Dart, use VS Code — it's lightweight, fast, and has excellent Dart support. If you're heading toward Flutter mobile development, Android Studio is worth learning eventually.

Next Up: Let's explore DartPad and the Dart CLI in detail and run your very first Dart program.

WhatsApp