Skip to main content

Install the Dart SDK

There are multiple ways to install a dart on your system. You can install Dart on Windows, Mac, and Linux or run it from the browser.

Requirements​

Dart SDK, VS Code or Editors like Intellij.

How To Install Dart On Windows?​

Follow the below instructions to install a dart on the windows operating system.

Steps:

  • Download Dart SDK from here.
  • Copy dart-sdk folder to your C drive.
  • Add C:\dart-sdk\bin to your environment variable. Watch the video below to be more clear.
  • Open the command prompt and type dart –version to check it.
  • Install VS Code and Add Dart Extension.
info

Note: Dart SDK provides the tools to compile and run dart program.

How To Install Dart On MAC?​

  • Install Homebrew From Homebrew. (It's a package manager for macOS)
  • Type brew tap dart-lang/dart in the terminal.
  • Type brew install dart the in terminal.
  • If you have any issues installing the dart, watch the video below.

Homebrew Install Command​

Copy and paste this command on your terminal to install Homebrew.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

To set the homebrew path, copy and paste this command on your terminal.

 export PATH=/opt/homebrew/bin:$PATH

Verify If Dart Is Installed Or Not​

Open your command prompt and type dart –version. The dart is successfully installed on your system if it gives you a version code. If not, watch the video above.

Some Useful Commands​

CommandDescription
dart –helpShow all available commands.
dart filename.dartRun the dart file.
dart createCreate dart project.
dart fixUpdate dart project to new syntax.
dart compile exe bin/dart.dartCompile dart code.
dart compile js bin/dart.dartCompile dart to javascript. You can run this file with Node.js.

Run Dart On Web​

You can run the dart program on your browser without installing any software. Dartpad is a web tool to write and run your dart code.

Can You Learn Dart From Mobile?​

Yes, you can use DartPad to run simple dart programs from your phone without installing any software. For bigger projects, using DartPad is not recommended.