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
- 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- Update repository lists and install the Dart SDK:
apt update
apt install -y dartNote: 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 --versionWriting 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 runRunning 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.dartCompiling to a Native Executable (AOT)
Compile your code into an optimized machine-code binary:
dart compile exe hello.dart -o hello
./hello