In this post we will start by installing the necessary dependencies for dart and then install the Dart compiler, after that we will install dart tools.
As of the this post the current version of Dart is 2.0 and the installation steps are for version 2.0 and its minor versions.
Install Dart via the command line / terminal.
Head over to your computer and start a terminal (CTRL + ALT + T) session, issue the following commands :
sudo apt-get update
Install the dependencies
sudo apt-get install apt-transport-https -y
Install the apt source path for future upgrades to your system
sudo sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
Now lets install the Dart SDK:
sudo apt-get update && sudo apt-get install dart -y
Check if dart is installed successfully
> dart --version
Thats all ! Dart is successfully installed on your system. Optionally, if you would like the Dart compiler to be available via the command line then please add the two lines below to your $HOME/.bashrc file.
Lets check if the environment variables are installed correctly, run the following commands :
> exec bash
This will reload the shell with the changes in .bashrc
Now you can use the command line tools by opening your favourite terminal application and running dart. Finally, dart is now installed on your Linux (Ubuntu) computer.
Official Dart Link : https://www.dartlang.org/tools/sdk
If you would like to setup and IDE to program in Dart to create websites or apps you can try out the Intellij IDE which is compatible with the dart compiler plugin. The next post describes the install process for Intellj IDEA Development Environment and the Dart plugin.