Skip to main content

Menu

System onlineAI Tutorials / 2026

AI Tutorials
Knowledge search

Recent · Popular · Tutorials

  • dart3 tutorials
  • java1 tutorial
  • Javascript3 tutorials
  • Node.js Introduction2 tutorials
  • dartdart · General · In depth
  • JavascriptJavascript · Advanced · In depth
  • JavascriptJavascript · Advanced · Mid
  • JavascriptJavascript · Advanced · Short

Find a tutorial

Tell the assistant what you want to learn. It suggests published chapters.

For example: “I want to learn Rust ownership from the start.” The conversation is kept only in this tab.

0 / 2,000 characters

Enter to send, Shift+Enter for a new line. Do not include personal information.

Chapter 1

What Is Dart and How Do You Run It?

Dart is a programming language made by Google. It is designed to feel familiar to anyone who has written code before, while adding modern touches like strong typing and built-in safety features. You write plain text files containing Dart code, and a tool called the **Dart SDK** (Software Development
Level: GeneralLength: Mid2 min read

Read at another depth

What Is Dart and How Do You Run It?

Dart is a programming language made by Google. It is designed to feel familiar to anyone who has written code before, while adding modern touches like strong typing and built-in safety features. You write plain text files containing Dart code, and a tool called the Dart SDK (Software Development Kit — the collection of programs needed to write and run Dart) turns that code into a running program.

Where Dart Is Used

Dart's most famous job is powering Flutter, Google's toolkit for building apps that run on phones, computers, and the web from one codebase. If you have used an app built with Flutter, you have used a Dart program. Dart also works well on its own for command-line tools, small servers, and scripts.

What Makes Dart Distinct

  • Statically typed: every value has a type (like text, whole numbers, or true/false) that the computer checks before your program runs. This catches many mistakes early.
  • Null safe: a value that might be "nothing" must be marked as such, so the language forces you to handle missing data carefully.
  • Portable: the same Dart code can run on Windows, macOS, and Linux with no changes.
  • Fast to start: you can run a Dart file directly, without a separate build step.

Installing the Dart SDK

  1. Visit the Dart website's install page (dart.dev).
  2. Follow the instructions for your operating system. On Windows, an installer is available; on macOS, a common option is brew install dart; on Linux, packages are provided.
  3. Open a new terminal and check that it worked:
Code example in bash
dart --version

You should see a version number. That command runs the Dart VM (the virtual machine — the engine that executes Dart code) and reports its version.

Running Your First Program

Create a file named hello.dart containing this line:

Code example in dart
void main() {
  print('Hello from Dart!');
}

Here, main is the special starting point of every Dart program — the computer looks for it and begins there. print displays text on the screen.

Run it from your terminal:

Code example in bash
dart run hello.dart

You should see:

Code example in text
Hello from Dart!

That is the whole cycle: edit a .dart file, run it with one command, see the result. No extra setup or configuration is needed for small programs.

How a Dart Program Reaches the Screen

A three-step flow. Your hello.dart file goes to the dart run command, which invokes the Dart virtual machine, which prints Hello from Dart on screen.
100%
The path from your source file to output on screen.
Show diagram source
flowchart LR
    A["hello.dart (your code)"] --> B["dart run (command)"] --> C["Dart VM (executes it)"] --> D["Output on screen"]

What Comes Next

In the next chapter, you will write a slightly bigger program and learn how Dart files are organized. After that, the tutorial builds up the language piece by piece: variables, decisions, functions, collections, and eventually classes and asynchronous code.

Exercise

What command do you use to run a Dart file called hello.dart, and what special function must every Dart program contain?

Show answer

Run it with dart run hello.dart. The program must contain a function named main, which is where execution begins.

Spotted a mistake, or code that does not work?

Report an issue

Chapter: What Is Dart and How Do You Run It?

0 / 2,000 characters

Plain text, for example: the second code sample does not compile. Do not include personal information.

You can't do that