skip to content

How do you install the Flutter SDK so flutter and dart work in any terminal, and what does flutter doctor flag when PATH is wrong?

level: juniorimportance: should knowfreq 40%

answer

  1. extract the SDK, add bin
  2. flutter and dart share bin
  3. first run fills bin/cache
  4. dart resolving outside the SDK
  5. IDE plugin, or DartPad with no install

basics

~10 s

Extract the Flutter SDK to a user-writable folder and put its bin directory on PATH, which provides both flutter and dart. Doctor warns when either is missing from PATH or resolves outside that SDK.

solid answer

~40 s

The Flutter SDK is a folder: you extract a bundle (or use the VS Code Flutter extension's Download SDK option) into a user-writable location and add `<sdk>/bin` to `PATH`. That directory holds both `flutter` and `dart`, and the first run downloads the Dart SDK and engine artifacts into `bin/cache`. `flutter doctor`'s Flutter section checks that `flutter` and `dart` on `PATH` resolve inside this SDK; if not, it warns that the binary is not on your path, or that it resolves to another location, and suggests putting the SDK's `bin` at the front. Editors need the Flutter plugin for VS Code or Android Studio, which pulls in the Dart plugin. DartPad runs single-file Flutter apps in a browser with no install at all.

code

bash · 6 lines
bash
# macOS / Linux, zsh: put the SDK's bin FIRST on PATH
echo 'export PATH="$HOME/develop/flutter/bin:$PATH"' >> ~/.zshrc
# open a new terminal, then verify
which flutter dart     # both should be inside ~/develop/flutter/bin
flutter --version      # channel, framework version and bundled Dart
flutter doctor

go deeper

for a junior

Remember to put the SDK's bin directory on PATH, open a new terminal, and confirm with flutter --version and flutter doctor.

for a middle

Explain that bin holds both flutter and dart, that Dart is bundled and cached per Flutter version, and what doctor's two PATH warnings mean.

for a senior

Resolve machines with several SDKs or a standalone Dart by fixing PATH order, and know doctor no longer covers IDE plugins.

for a principal

Decide how new developers are onboarded: documented manual install, editor-driven install, or scripted setup, and which of them keeps SDK versions consistent.

## What installing Flutter means The Flutter SDK is not an installer-managed application; it is a **directory** you place somewhere and point your shell at. Three ways to get it: 1. **Download a bundle** for your OS from the SDK archive and extract it. The docs suggest a short, user-writable path; on Windows a long path can trip the path-length limit during `flutter upgrade`. 2. **Clone** the Flutter repository and check out the `stable` branch; either way the SDK is a git checkout, which is why git is an install prerequisite. 3. **Let the editor do it**: in the VS Code quick-start flow, the Flutter extension offers a **Download SDK** option. Then, per operating system, add the SDK's **`bin` directory** to the `PATH` environment variable, so `flutter` and `dart` resolve in any new terminal and in IDEs launched from it. ## What lives in bin - `flutter` — the Flutter tool. - `dart` — a wrapper that runs the Dart SDK **bundled with this Flutter version**; Flutter 3.47 ships Dart 3.13. - `internal/` — scripts and version stamps the wrappers use. On the first run the wrappers download the matching Dart SDK into `bin/cache/dart-sdk` and fetch engine artifacts, which is why the first `flutter` command is slow. You never install Dart separately for Flutter work. ## What doctor checks about PATH The `Flutter` validator resolves both binaries on `PATH` and compares them with the running SDK: | Situation | Doctor's hint | |---|---| | `flutter` or `dart` not found on `PATH` | `The <binary> binary is not on your path. Consider adding <sdk>/bin to your path.` | | Found, but resolves outside this SDK | `Warning: <binary> on your path resolves to <path>, which is not inside your current Flutter SDK checkout at <sdk>. Consider adding <sdk>/bin to the front of your path.` | The second case is the common one: a standalone Dart SDK installed by a package manager, or a second Flutter SDK from an older setup, sits earlier on `PATH`. Then `dart format` or `dart fix` may run a different Dart version from the one Flutter compiles with. The fix is ordering, not uninstalling: put the Flutter SDK's `bin` **first**. Symlinks are resolved before comparing, so a link pointing into the SDK is fine. ## Editors and plugins - **VS Code**: install the Flutter extension; it adds commands such as `Flutter: New Project` and `Flutter: Select Device`, and brings the Dart extension with it. - **Android Studio / IntelliJ**: install the Flutter plugin, which requires the Dart plugin. - The plugins find the SDK from `PATH` or from the path you give them, and cache tool settings, so restart them after changing `flutter config`. Since Flutter 3.38, `flutter doctor` no longer validates IDEs or their plugins, so a missing plugin shows up in the editor, not in doctor. ## DartPad: Flutter with no install DartPad is a browser-based editor that builds and runs **single-file** Dart and Flutter programs on the web. It is useful for: - trying Flutter before installing anything; - sharing a minimal reproduction of a widget behaviour; - interviews and teaching, where setup time matters. It is not a development environment: there is no multi-file project, no platform folders, and no Android, iOS or desktop build. ## A quick verification sequence 1. Open a **new** terminal so it reads the updated `PATH`. 2. Run `which flutter` and `which dart` (or `where` on Windows); both should point into the SDK's `bin`. 3. Run `flutter --version` to confirm the channel and bundled Dart version. 4. Run `flutter doctor` and work through the remaining sections.

  • Why does doctor warn when dart on PATH resolves outside the Flutter SDK, if Flutter itself still works?
    The `flutter` tool uses its own bundled Dart, but commands you type as `dart ...` run whatever comes first on `PATH`. A different Dart version can format, analyse or fix code differently from the SDK that builds the app. Doctor flags it so both commands use the same version; prepend the Flutter SDK's `bin`.
  • Do you need to install the Dart SDK separately to develop Flutter apps?
    No. The Flutter SDK's `bin/dart` wrapper runs the Dart SDK version that Flutter downloads into `bin/cache/dart-sdk` on first run, pinned to that Flutter release. A separate Dart install is only needed for Dart work without Flutter, and it should not come before Flutter on `PATH`.

Putting bin on PATH is like listing one reception desk in the building directory: if an older desk appears first in the directory, visitors reach the wrong one even though the right desk exists.

saying these in an interview costs you the question

  • Installs Dart separately and puts it ahead of Flutter on PATH
  • Adds the SDK root instead of its bin directory to PATH
  • Expects flutter doctor to report a missing VS Code plugin
  • Treats DartPad as a replacement for a local toolchain
  • Keeps using an old terminal and concludes the PATH change failed