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β
Command | Description |
---|---|
dart βhelp | Show all available commands. |
dart filename.dart | Run the dart file. |
dart create | Create dart project. |
dart fix | Update dart project to new syntax. |
dart compile exe bin/dart.dart | Compile dart code. |
dart compile js bin/dart.dart | Compile 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.
Install Dart Official Linkβ
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.