×

Dart Installation Guide

There are various ways of compiling and running an application created in Dart, either by compiling the Dart code to JavaScript using the Dart2js tool or by running on the command line, hosted in a Dart virtual machine using SDK. This feature allows the application's client and server parts to be written in the same language. Online compiler Dart Pad can also be used to run Dart code. Some IDEs which support Dart language are WebStorm, Intellij, Eclipse, Visual Studio Code, Android Studio, etc.

SDK (SOFTWARE DEVELOPMENT KIT) INSTALLATION

Follow the below instructions to install Dart SDK on Windows.

Step – 1 : Go to the browser and search ‘get Dart SDK’. Click on the first hyperlink, “Get the Dart SDK”, and scroll down to the bottom of the page and select the hyperlink “downloading the SDK as a zip file”.

Or directly visit the following link : https://Dart.dev/get-Dart/archive

Dart Installation Guide

Step – 2 : After clicking this hyperlink, you will be directed to the “Dart SDK Archive” page.

Dart Installation Guide

To download any other version of Dart for any other Operating system, directly choose from Version and OS dropdown menu (circled with greens).

On clicking, the download will begin, and a zip file will be downloaded.

Step – 3 : Open the zip file and extract the contents of the file to a suitable location as follows.

Dart Installation Guide

Step – 4 : Select and open the bin folder and copy the path by right-clicking on the bar that specifies the location.

Step – 5 : Go to advanced settings under System Properties and click on the ‘Environment Variables’ button to add the SDK path.

Dart Installation Guide

After clicking, the following dialogue box will appear. Under system variables, click on the path and create space for a new path and paste the path you copied.

Dart Installation Guide Dart Installation Guide

Click ‘ok’ after adding the new path. The path will be successfully added!

Step – 6 : Run Dart using the command prompt. Search for the command prompt and write Dart, and press enter.  Various commands are listed to operate with Dart code.

Dart Installation Guide

You will first have to write the code in Notepad and run it using the command prompt.

Dart2js Tool

The Dart2js tool comes in-built with the Dart SDK. This tool converts the Dart language code into JavaScript code, making it compatible with modern web browsers.

In order to compile the Dart code into JavaScript, write the following command in command prompt,

Dart2js - - out = <output_file>.js  <Dart_script>.Dart  

This will generate an equivalent JavaScript code.

DartPad

Step – 1 : Search DartPad on the browser and click on the first hyperlink. Or directly click on https://Dartpad.dev/

The following page will open.

Dart Installation Guide

Dart IDE

The IntelliJ, WebStorm and Eclipse are some of the IDEs from Jet brains that support the Dart language.

WebStorm can be downloaded from the given link,

https://www.jetbrains.com/webstorm/download/#section=windows-version

  1. VISUAL STUDIO CODE

Step – 1 : If you have already downloaded the VS Code. Go to extensions and search for Dart.

Dart Installation Guide

Step – 2 : Install “Dart language support and debugger for visual studio code”.

Step – 3 : Create a new file, write your code and save it with extension ‘.Dart’.

Dart Installation Guide

Step – 4 : Compile and run the code by either pressing F5 or the play button.

Step – 5 : If you haven’t downloaded the VS Code. Search on Google ‘download VS Code’ and click on the first hyperlink.

Dart Installation Guide

It will direct you to the following page.

Dart Installation Guide

Step – 6 : Choose the correct option with respect to the operating system you are working on. Downloading will begin, and an exe setup file will be downloaded.

Step – 7 : Open and run the file. Proceed with choosing the right location, and Visual Studio will be installed.

Step – 8 : Follow the steps from 1 to 4 to run the Dart language code.


Related Topics

Lexical Scope and Closure

Lexical Scope : Lexical scope is a very important term in any programming language. It defines the scope of the variable based on the block it is contained inside. According to...

2 minutes read.

Dart Tutorial

Dart is an open-source, structured programming language developed by Google. It is a high-level programming language that emerged in 2011, but its stable version emerged in 2017. It is largely used...

4 minutes read.

Dart Arithmetic Operators

Arithmetic Operators comprises of all the operators that are used to perform arithmetic operations such as addition, subtraction, multiplication, division, etc. They are binary operators that work upon two operands. Consider A...

2 minutes read.

Dart Types of Functions

Functions are the set of statements intended to perform a specific task. They accept some input from the user, perform the specified computation and generate the output. They are very...

4 minutes read.

Dart Loops

Looping refers to repeating or reusing the same lines of code repeatedly until a particular test condition evaluates to true. It is also known as iterating.  It is effectively used when...

4 minutes read.

Dart Packages

Every programming language has some in-built functions stored inside the header files that makes the task much easier for the programmer. The Dart Packages refer to the compilation of a...

4 minutes read.

Dart Maps

Map is an object-based data structure that associates keys and values that can be of any data type. Every key can occur only once, while the values can be used multiple...

5 minutes read.

Dart Single-Page Application Architecture

In a single page application architecture, the source code for a single web page loads the entire application. The responsibility of building the user interface and requesting data from the...

2 minutes read.

Assert in DART

In any programming language, resolving error is the most unwanted and tedious task. At times it becomes very difficult to find the error in the large code. Dart offers an...

3 minutes read.

Common Collection Methods

Most of the programming languages have arrays as a way to list items together. However, Dart has a collection of data structures similar to array. These are supported by the...

3 minutes read.

Dart Enumerations

Enumeration data type in Dart In simple terms, Enumerations are referred to as named constant values. Constant values are declared as enumerations using the ‘enum’ keyword.  Implementation =  enum enum_name {    ...

2 minutes read.

Abstract Classes in Dart

Abstract classes in Dart are those classes that only contain abstract methods  (methods that do not contain any implementation). These classes are specifically designed for the purpose of inheritance. We...

4 minutes read.

Dart - extends, with and implements Keywords

The application development in Dart programming language using the Flutter framework, regularly experience different usage of the implements, extends and with keywords. Dart has full support for inheritance that is...

5 minutes read.

Callable Classes in Dart

Just like the functions, we can also call the instances of classes in Dart. Such classes are also known as “callable ” classes. We need to use the “call( )”...

3 minutes read.

Dart Miscellaneous Operators

Apart from the operators we studied so far, Dart provides some more operators which are as follows : Conditional OperatorCascade Notations Conditional Operators These are the operators that help in evaluating the expression...

1 minute read.

Dart Break and Continue

Loop statements are used to change the normal sequence of flow of the program. Dart supports two types of loop control statements: Break StatementContinue Statement Break Statement : The ‘ break ’ statement is...

4 minutes read.

Dart Basics

Dart, as earlier mentioned multiple times, is very similar to C, C++ and Java. It is an object-oriented, garbage collecting and class-based programming language. Let’s look further and see what Dart has...

10 minutes read.

Interfaces in Dart

An interface in Dart refers to the syntax or blueprint that any class must adhere to. It basically defines the array of methods available on the object. It provides the...

3 minutes read.

Dart Iterable

Iterable is a collection of elements that are accessed sequentially. These elements are accessible using the iterator getter and stepping through the values using this getter. Let us understand the setting...

6 minutes read.

Dart - Control Flow Statements

The control flow statements are used to define the control on the flow of the program. Dart programs are executed in sequential order i.e., the order in which the programming...

1 minute read.