Table of Contents
Get Started
Dart Installation
Dartpad
Local Setup
Comments in Dart
Variables
Numbers in Dart
Double in Dart
Integer in Dart
String in Dart
Operation on String
String Interpolation
Boolean in Dart
Operator
Decision Making
Switch in Dart
Ternary Operator
Loops
List in Dart
Operation on List
Map in Dart
Dart Installation #
There are three major OS and I am pretty sure you also use one of them.
Windows #
Use Chocolatey to install a stable release of the Dart SDK:
Chocolatey is the Package Manager for Windows and it will help you in installing via Command Prompt/ Powershell.
$ choco install dart-sdk
Linux #
You can use Aptitude to install the Dart SDK on Linux.
- Perform the following one-time setup:
$ sudo apt-get update
$ sudo apt-get install apt-transport-https
$ 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'
- Install the Dart SDK
$ sudo apt-get update
$ sudo apt-get install dart
macOS #
With Homebrew, installing Dart is easy.
Installing on macOS is earliest among all these three OS. You just have to run two commands and you are ready to get started with Dart
.
$ brew tap dart-lang/dart
$ brew install dart