Introduction to Dart : Hello , Dart

Introduction to Dart

Chapter 1: Hello, Dart

I- Introduction

According to the official Dart Documentation, Dart is a client-optimized language for developing fast apps on any platform. Its goal is to offer the most productive programming language for multi-platform development, paired with a flexible execution runtime platform for app frameworks.

during this Course, I'm going to guide you step by step to become an expert in Dart. in this chapter we will see how to set up our environment to build programs in Dart, in a further course we will see how to apply our knowledge in Dart to built cross-platform Apps using the Flutter Framework.

II- Try Dart

to use dart it's not necessary to have a powerful computer or to set up a development environment in your computer. Dart offers a great tool called DartPad a simple browser-based tool for writing and executing Dart code, you can test it by visiting dartpad.dev

dartpad screenshot


III- Setting up Dart

To be able to code in Dart we will need two things: 
    1- the Dart Software development Kit
    2- A text editor or an IDE (eg: Visual Studio Code, IntelliJ IDEA …)
In this course, we will use Visual Studio Code as our text editor for several reasons
    - it's lightweight
    - it's open-source
    - it contains a lot of extensions that make programming in dart easy


IV-Installing Visual Studio Code

Visual Studio Code is a cross-platform IDE from Microsoft, it runs on Windows, Linux, and macOS.

Visit code.visualstudio.com and follow the steps to download and install it on your computer.
after downloading and installing Visual Studio Code click the extension tab and install the Dart extension.

V-Installing Dart SDK

The Dart SDK has the libraries and command-line tools that you need to develop Dart web, command-line, and server apps.

visit the dart.dev/get-dart  and follow the steps to install the Dart SDK on your machine.




Check that Dart is Installed

to check that your environement is installed and works fine, open your terminal, and run this command

dart --version


and it will show you the SDK version that you've installed

Write Your First Dart Program

now that everything is setup, open VsCode, create a new filled and name it "hello.dart"
Note: every dart file finish with the .dart extension

after openeing your file, write the code below

void main(){
  print("Hello, Dart!");
}

Key Points

  • DartPad is a browser-based editor that allows you to write and run dart code directly on your browser and on any device
  • Dart SDK provides you tools needed to run Dart Code
  • Visual Studio Code is an IDE that you can use to write and execute dart code when you have the Dart extension installed


Introduction to Dart : Hello , Dart Introduction to Dart : Hello , Dart Reviewed by Medics on November 01, 2021 Rating: 5

1 comment:

-->
Powered by Blogger.