Chapter 2. “Hello World” with Dart tools

 

This chapter covers

  • Discovering the Dart tool set
  • Building apps with the Dart Editor
  • Tools for debugging apps
  • Running apps in the browser
  • Deploying apps to JavaScript

Dart has a rich tool ecosystem that enables you to write, run, and debug Dart code in a variety of environments. Google takes a “batteries included” approach to the Dart tools and fully intends to provide all the tools you’ll require to build complex applications. The Dart tools are currently available for Windows, Mac, and Linux platforms; you can find them on Google’s dartlang.org website.

The Dart tool set starts with the Dart Virtual Machine (Dart VM). The virtual machine exists in two guises. First, it’s on the server as a command-line runtime environment, similar to a Java, Python, or Ruby VM; you’ll use this version to run a simple “Hello World” application. In its second incarnation, it’s embedded in a version of the Chrome web browser called Dartium, where it has access to the browser document object model (DOM). You’ll see Dartium when you use the Dart Editor to edit and run the same “Hello World” application in the browser, but this time hosting the Dart script in an HTML file.

2.1. The command-line Dart VM

2.2. “Hello World” with the Dart Editor

2.3. Importing libraries to update the browser UI

2.4. Summary

sitemap