TIDE
Languages

Dart

Installing Dart SDK on Ubuntu in TIDE

Dart

Dart is a client-optimized, object-oriented language developed by Google. Designed for multi-platform development, Dart is famous as the foundation for the Flutter framework, featuring sound null safety, fast hot-reloading with JIT compilation, and efficient AOT (Ahead-of-Time) binary compilation.

Installation

The official Dart SDK is maintained in Google's Debian/Ubuntu repository.

Using Official Google APT Repository

  1. Install prerequisites and import the GPG signing key securely:
apt update
apt install -y apt-transport-https wget gpg

wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/dart.gpg
echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' | tee /etc/apt/sources.list.d/dart_stable.list
  1. Update repository lists and install the Dart SDK:
apt update
apt install -y dart

Note: If you have Flutter installed on your system, the complete Dart SDK is already bundled inside the Flutter SDK directory.

Verification

Check the installed Dart version:

dart --version

Writing and Running Code

Creating a Dart Console App

You can generate a structured console application template using the CLI:

dart create -t console hello_app
cd hello_app
dart run

Running a Standalone Script

Create a source file named hello.dart:

void main() {
  print('Hello, World from Dart in TIDE!');
}

Execute the script with JIT compilation:

dart run hello.dart

Compiling to a Native Executable (AOT)

Compile your code into an optimized machine-code binary:

dart compile exe hello.dart -o hello
./hello

Official Resources

On this page