Web Analytics Made Easy -
StatCounter

Dart

Dart

Google Dart

Dart is a client-optimized language by Google for fast apps on any platform.

Optimized for UI

  • Mature and complete async-await for user interfaces containing event-driven code, paired with isolate-based concurrency
  • A programming language optimized for building user interfaces with features such as the spread operator for expanding collections, and collection if for customizing UI for each platform
  • A programming language that is easy to learn, with a familiar syntax

Productive development

  • Make changes to your source code iteratively, using hot reload to instantly see the effect in the running app
  • Write code using a flexible type system with rich static analysis and powerful, configurable tooling
  • Do profiling, logging, and debugging with your code editor of choice

Platforms

You can use Dart to write simple scripts or full-featured apps. Whether you’re creating a mobile app, web app, command-line script, or server-side app, there’s a Dart solution for that.

Flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:

  • Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.
  • Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).

Dart Native (VM JIT and AOT)

Dart Native enables running Dart code compiled to native ARM or X64 machine code for mobile, desktop, and server apps.

The Flutter framework is a popular multi-platform UI toolkit that’s powered by Dart Native when targeting mobile or desktop devices.

More information:

  • Flutter get started documentation
  • Get started: command-line and server apps
  • Write command-line apps
  • Write HTTP clients and servers

Lightning fast developer workflow (Dart VM JIT)

Having a fast developer cycle is critical for iteration.

The Dart VM has a just-in-time compiler (JIT) that supports both Pure interpretation (as required on iOS devices, for example) and runtime optimization.

Optimized production code (Dart AOT)

When apps are ready to be deployed to production — whether you’re publishing to an app store or deploying to a production backend — you can use the Dart AOT compiler to ahead-of-time compile your app to native ARM or X64 code machine code. Your AOT-compiled app starts instantly and runs smoothly.

The AOT-compiled code runs inside an efficient Dart runtime that enforces the sound Dart type system and manages memory using fast object allocation and a generational garbage collector.

Dart Web (JavaScript)

Dart Web enables running Dart code on web platforms powered by JavaScript. With Dart Web, you compile Dart code to JavaScript code, which in turn runs in a browser — for example, V8 inside Chrome.

The Flutter framework, a popular multi-platform UI toolkit, is powered by Dart Web when targeting web apps. The AngularDart framework, a popular web app toolkit, is also powered by Dart Web.

Lightning fast developer workflow (Dart dev compiler)

The Dart dev compiler (dartdevc) is a Dart-to-JavaScript compiler that’s optimized for quick turnaround. Instead of using dartdevc directly, you use it with webdev, a tool that supports core developer tasks such as running, debugging, and building.

Optimized production code (Dart JS compiler)

The dart2js tool compiles Dart code to fast, compact, deployable JavaScript. It employs techniques such as dead-code elimination

Hello World

Every app has a main() function. To display text on the console, you can use the top-level print() function:

void main() {
  print('Hello, World!');
}

Variables

Even in type-safe Dart code, most variables don’t need explicit types, thanks to type inference:

var name = 'Voyager I';
var year = 1977;
var antennaDiameter = 3.7;
var flybyObjects = ['Jupiter', 'Saturn', 'Uranus', 'Neptune'];
var image = {
  'tags': ['saturn'],
  'url': '//path/to/saturn.jpg'
};

src.:
dart.dev
Language samples
Platforms
Deployment tips
dart2js compiler
webdev tool

🎰