Dart Installation
We must set up the Dart programming environment on our local machine in order to study the language. The following instructions will walk you through installing the Dart SDK (Software Development Kit) on different operating systems. You can skip this step if you have already installed it.
Install the Dart SDK on Windows
To install Dark SDK on Windows, adhere to the procedures given below.
Step 1: Open the browser and enter the URL below to start the SDK download.
http://www.gekorm.com/dart-windows/
It will launch the specified page. Select the hyperlink that follows.
It will open the given page. Click on the following link.
Step 2: Click the Next button and launch the Dart installer (which is the.exe file that we downloaded in the first step).
Step 3: It gives you the choice of where to install Dart. Click the Next button after selecting the path.
Step 4: In advance system properties, set the PATH environment variable to “C:\Program Files\Dart\dart-sdk\bin” when the download is finished.
Step 5: Type dart to confirm the installation of Dart by opening the terminal.
If installation is successful, it will resemble the picture up above.
Install the Dart SDK on Linux
The following lists the steps needed to install Dart on Linux.
If you are running Debian/Ubuntu on AMD64 (64-bit Intel) on your local computer, you can install the Dart using one of the following methods prior to installing it.
- Â Install using apt-get
- Install a Debian package
Installation using apt-get
Step 1: For a one-time setup, type the commands below.
$sudo apt-get update
$ sudo apt-get install apt-transport-https
$ 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'
Step 2: Use the apt-get option to install the Dart SDK by typing the following command into the terminal.
$sudo apt-get update
$ sudo apt-get install dart
The Dart SDK will download successfully.
Installation a Debian Package
The Dart SDK is available for download as a Debian package in the .deb package format. The following command must be entered to modify the PATH in order to make all Dart binaries accessible.
export PATH="$PATH:/usr/lib/dart/bin"
Use the following command to modify the PATH for next terminal sessions:
$ echo 'export PATH="$PATH:/usr/lib/dart/bin"' >> ~/.profile
Install the Dark SDK on Mac
Step 1: Install Homebrew and execute the following command if you don’t already have the Homebrew package manager. The Mac version of Dart will download without any issues.
$brew tap dart-lang/dart
$ brew install dart
Step 2: Use the following command to see which version we have installed.
$brew info dart
Online Dart Editor
Thus far, we have talked about installing Dark software on different operating systems. However, if we prefer not to install Dark software, we can use DartPad, an online Dark editor, to execute Dark programs. You can access the DartPad online at https://dartpad.dev/. The DartPad can show HTML and console output in addition to running Dart scripts. The graphic below depicts how the online DartPad appears.
Dart IED Support
The Jet brains’ IDEs for Dart programming are Eclipse, IntelliJ, and WebStorm, albeit WebStorm is more widely used than the others. From https://www.jetbrains.com/webstorm/download/#section=windows-version, we may download it.
The dart2js Tool
The dart2js tool, which translates Dart code into JavaScript code that can be executed, is included with the Dark SDK. Few web browsers do not support the Dart VM, therefore it is required.
The Dart code can be compiled into JavaScript code by typing the following command into the terminal.
dart2js - - out = .js .dart
The JavaScript code that corresponds to the Dart code will be created in a file by using the aforementioned command.