Dart

Google's language optimized for building beautiful, natively compiled applications with Flutter.

Object-Oriented
Functional
Beginner
2011
Lars Bak, Kasper Lund (Google)

Overview

Dart is a client-optimized language for developing fast apps on any platform. It is the language behind Flutter, Google's UI toolkit for building natively compiled applications for mobile, web, and desktop from a single codebase. Dart features a sound type system, null safety, and can compile to ARM and x64 machine code or to JavaScript for the web.

Key Features

  • Sound null safety — Eliminates null reference exceptions at compile time
  • Hot reload — Instant UI updates during development (via Flutter)
  • AOT & JIT compilation — Fast development (JIT) and fast production (AOT)
  • Isolates — Concurrency model without shared-state threads
  • Single codebase — Build for iOS, Android, web, and desktop with Flutter

Code Example

dart
Future<String> greetUser(String? name) async {
  final displayName = name ?? 'Guest';
  await Future.delayed(Duration(seconds: 1));
  return 'Welcome, $displayName!';
}

void main() async {
  print(await greetUser('Alice'));
  print(await greetUser(null));
}

Learning Resources

Learning Path

16 topics across 4 sections

1Basics

  • Introduction to Dart — Dart VM, AOT/JIT compilation, and DartPad
  • Variables & Types — var, final, const, dynamic, and Dart's sound type system
  • Functions — Arrow syntax, optional params, named params, and closures
  • Control Flow — if/else, switch, for, while, and pattern matching (3.0+)
  • Null Safety — Non-nullable by default, ?, !, late, and required

2OOP in Dart

  • Classes — Constructors (named, factory, const), this, and cascade notation (..)
  • Inheritance & Mixins — extends, implements, with, and mixin classes
  • Generics — Generic classes, functions, and type constraints
  • Enums — Enhanced enums with methods and implementations

3Async & Collections

  • Futures — async/await, Future.then, and error handling
  • Streams — Single-subscription, broadcast streams, and StreamBuilder
  • Isolates — Concurrent execution without shared-state threads
  • Collections — List, Set, Map, Iterable, and collection literals

4Flutter & UI