This guide provides a step-by-step process for installing Dart on various operating systems.
Prerequisites#
Before installing Dart, make sure you have the following:
- An internet connection.
- Administrative access to your computer.
Installation on Windows#
-
Download the Dart SDK:
- Visit the official Dart SDK archives here .
- Choose the version suitable for Windows and download the zip file.
-
Extract the SDK:
-
Extract the contents of the downloaded zip file to a directory
of your choice (e.g.,
C:\Dart).
-
Extract the contents of the downloaded zip file to a directory
of your choice (e.g.,
-
Update your PATH:
- Search for ‘Environment Variables’ in your Windows search and select “Edit the system environment variables”.
- In the System Properties window, click on “Environment Variables”.
- Under “System variables”, find and select “Path”, then click “Edit”.
-
Click “New” and add the path to your Dart
SDK’s
bindirectory (e.g.,C:\Dart\dart-sdk\bin). - Click “OK” to close all dialogs.
-
Verify Installation:
-
Open a new command prompt and type
dart --versionto check if Dart is correctly installed.
-
Open a new command prompt and type
Installation on macOS#
-
Install Homebrew:
-
If not already installed, open a terminal and run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
-
If not already installed, open a terminal and run:
-
Install Dart:
-
Using Homebrew, install Dart by running:
brew tap dart-lang/dart brew install dart
-
Using Homebrew, install Dart by running:
-
Verify Installation:
-
In your terminal, type
dart --versionto ensure Dart is installed correctly.
-
In your terminal, type
Installation on Linux#
-
Enable apt over HTTPS:
-
Run the following commands in your terminal:
sudo apt-get update sudo apt-get install apt-transport-https
-
Run the following commands in your terminal:
-
Set up Dart repository:
-
Run these commands to add the Dart repository to your system:
sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -' sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
-
Run these commands to add the Dart repository to your system:
-
Install Dart SDK:
-
Update your package list and install the Dart SDK:
sudo apt-get update sudo apt-get install dart
-
Update your package list and install the Dart SDK:
-
Verify Installation:
-
Run
dart --versionin your terminal to check the Dart SDK installation.
-
Run
Next Steps#
After installing Dart, you might want to:
- Explore Dart packages on Pub.dev .
- Learn more about Dart by visiting official tutorials .
- Start your first Dart project!
Feel free to adjust paths and settings according to your preferences and system specifics.