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
- Stable Channel: this sdk is ready for production.
- 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.
- Dev Channel: dev channel has all new feature developed by developers. It has a high risk of bugs and highly unstable.
To install dart SDK, we need to go its official website: https://dart.dev/get-dart
Follow these Steps:
Install Dart using Chocolatey Package Manger
- Go to https://chocolatey.org/ and click on install now link
- Open power cell in window 10 with the rights of admin.
- 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’))
- Wait a few seconds for the command to complete.
- If you don’t see any errors, you are ready to use Chocolatey!
- 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: