Introduction
In this blog, we are going to look at the procedure to install Dart SDK on your system. The process is fairly simple in which one needs to download a zip file, extract it, place it in the destination folder and start programming in Dart. Since the Dart SDK is pre-compiled, we do not need to compile it manually again.
Steps to install Dart on your system
In this section, we will see a step by step procedure to install Dart SDK on your system and set up the development environment.
Download Dart SDK
The first step is to download the Dart SDK from the official website. Under the Dart SDK archive page, download the correct version according to Operating System installed on your system.
For example, the above image depicts the Operating System selected as Windows. You can change the OS from the drop-down menu.
Extract the ZIP file
The next step in the line is to unzip the zip file of the Dart SDK that we downloaded in the previous step. After extracting the contents of the zip, paste it into the directory where you want to set up the Dart SDK.
For example, the above image depicts that the dart-sdk folder has been placed in the directory E:\dart-sdk.
Setting up Environment Variables
For using the Dart compiler from anywhere inside your system, set the path of the Dart SDK in your system's environment variables. The environment variables can be found by writing environment variables in the start menu, as shown below.
After this, the following window will appear. Click on the button named Environment Variables.
After clicking on the button, add the bin folder path present inside your dart-sdk directory under the variable named PATH. For example, in my case, I need to add E:\dart-sdk\bin to the environment variable named PATH.
Verify the installation
To verify the installation, open up a command prompt/terminal from any directory on your machine. Type the following command on the cmd.
Command: dart
If you see a similar output, then congratulations, you have successfully installed Dart on your machine. Also, read the blog Dart Operators to enhance your skills in Dart programming.
It is advised to install an IDE for a smooth development process, although it is not mandatory to install one. For example, you can install Android Studio, which is quite commonly used for developing applications. Feel free to refer to the blog Android Studio and Environment Setup on the Coding Ninjas Website to go over the details to set up your environment.