Dart Installation – Brain Mentors Skip to content

Dart Installation

Hello readers, today we are going to install dart language. Before installing dart language, let’s discuss something above dart language.

Dart is a general purpose programming language developed by Google in 2011. It is used to build application for mobile, desktop, server and web application.

Dart can compile either native code or Java Script. Dart suppose mixins, interfaces, abstract classes, generics etc.

Dart SDK has three types of Channels

  1. Stable Channel: this sdk is ready for production.
  2. Beta Channel: is for preview of new features, if everything is fine then update in stable release. It is advised to use only for testing purpose.
  3. Dev Channel: dev channel has all new feature developed by developers. It has a high risk of bugs and highly unstable.

Install Dart

To install dart SDK, we need to go its official website: https://dart.dev/get-dart

Follow these Steps:

    1. You can use package manager (chocolatey).
    2. Alternatively, you can build the SDK from source by following this link: https://github.com/dart-lang/sdk/wiki/Building
    3. Or install from any release by following this link to download the SDK as zip file: https://dart.dev/tools/sdk/archive

Install Dart using Chocolatey Package Manger

  1. Go to https://chocolatey.org/ and click on install now link
  2. Open power cell in window 10 with the rights of admin.
  3. Now run the following command from power-cell

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1’))

  1. Wait a few seconds for the command to complete.
  2. If you don’t see any errors, you are ready to use Chocolatey!
  3. Now to install Dart SDK use this command

“choco install dart-sdk”

Install Dart SDK using zip file

Go to this link: https://dart.dev/tools/sdk/archive

Download stable version of dart as showing in below image:

After downloading zip file extract dart sdk e.g c:\src\dart-sdk

Now copy path up to bin directory (C:\src\dart-sdk\bin) and paste it into user environment variables as shown below image:

Now go to terminal and run “dart –version” to check if dart installed successfully or not.

If dart installed, we will see the below result

Now dart is installed, Use dart in VS Code

Install Visual code studio in your system by using following link: https://code.visualstudio.com/download

After installing Visual Studio code open VS Code

Add dart extension to VS Code

Now create a folder in any drive and select in VS Code

Create a new file main.dart and add main function in it like showing in below image:

Sign Up and Start Learning