×

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

Dart Objects

Apart from the built-in data types, Dart offers some other data types that have a special role to play. One of them is Objects.  Objects Objects are the foundation of the...

3 minutes read.

Dart this Keyword

The ' this ' keyword, similar to that in Java and C#, refers to an object of the class using it. It points to the current object of the class,...

5 minutes read.

Dart Future and Stream

Before understanding Future and Stream in Dart, we need first to get familiar with two terms : Synchronous and Asynchronous Programming.  In synchronous programming, a single operation is handled at a...

9 minutes read.

Dart Strings

Strings data type in Dart A Dart string is a sequence of characters with an encoding of UTF-16. The text associated with string data type is enclosed withing single (‘  ’)...

3 minutes read.

Dart Exception Handling

Exception Class – An exception is any runtime error that leads to abrupt termination of the program. It helps in addressing the error programmatically. It is aimed to be caught...

4 minutes read.

Dart lists data type

The most important data type in any programming language is an ordered list of elements, an array. Dart lists resemble JavaScript array lists. Example,               var...

7 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 Symbols

Symbols data type in Dart A symbol is an object that is the representation of an operator or identifier in Dart. These are compile-time constants.  They are used in APIs that refer...

1 minute 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 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 Isolates

Dart successfully supports asynchronous programming which runs our program without any hindrance. This asynchronous programming is used to achieve concurrency. Dart supports concurrent programming with features such as ‘ async-await...

9 minutes read.

Dart Numbers

Dart provides an in-built data type ‘Numbers’ that provides two types of values: intdouble 1. int data type int data type supports integer values, and their size or values range is platform-dependent. Integers...

4 minutes read.

Dart Type Test Operators

Type Test Operators in Dart These operators are used to check the types of expressions at runtime. Dart is a typed language, and we often want to assert that a value...

1 minute read.

Typedef in Dart

In Dart, typedef is used to generate a function type that we can use as a type annotation for declaring variables and return types of the function type. An alias...

4 minutes read.

Dart Sets

Sets data type in Dart A set is an unordered collection of items that are unique. Dart infers that sets tale strings as values. Example, var languages = { ‘Dart’ , ‘Flutter’, ‘Python’,...

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.

Dart Recursion

Recursion is one of the most important and interesting concepts in any programming language. It can be defined as a process in which a function calls itself directly or indirectly....

5 minutes read.

Dart Features

Dart is a fully-featured, object-oriented modern language with its roots in the programming language ‘Smalltalk’. It has some of its eminent features similar to the languages such as Java, C#...

4 minutes read.

Dart URIs

The Uri class supports encoding and decoding of strings with the help of functions to be used in URIs ( which may also be known as URLs ). These functions...

6 minutes read.

Dart Concurrency

Dart concurrency allows us to run multiple or multiple components of a system at once. It issues several commands at once. Dart provides Isolates as a tool for performing compliance...

2 minutes read.