Dart in Action
Chris Buckett
Foreword by Seth Ladd
  • January 2013
  • ISBN 9781617290862
  • 424 pages
  • printed in black & white

Includes numerous examples of core language features as well as more advanced HTML5 features.

From the Foreword by Seth Ladd, Developer Advocate, Google

Dart in Action introduces Google's Dart language and provides techniques and examples showing how to use it as a viable replacement for Java and JavaScript in browser-based desktop and mobile applications. It begins with a rapid overview of Dart language and tools, including features like interacting with the browser, optional typing, classes, libraries, and concurrency with isolates. After you master the core concepts, you'll move on to running Dart on the server and creating single page HTML5 web applications.

Table of Contents detailed table of contents




about this book

about the cover illustration

Part 1 Introducing Dart

1. Hello Dart

1.1. What is Dart?

1.2. A look at the Dart language

1.3. Web programming with Dart

1.4. The Dart tool ecosystem

1.5. Summary

2. “Hello World” with Dart tools

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

3. Building and testing your own Dart app

3.1. Building a UI with dart:html

3.2. Building interactivity with browser events

3.3. Wrapping structure and functionality with classes

3.4. Unit-testing the code

3.5. Summary

Part 2 Core Dart

4. Functional first-class functions and closures

4.1. Examining Dart functions

4.2. Using first-class functions

4.3. Closures

4.4. Summary

5. Understanding libraries and privacy

5.1. Defining and importing libraries in your code

5.2. Hiding functionality with library privacy

5.3. Organizing library source code

5.4. Packaging your libraries

5.5. Scripts are runnable libraries

5.6. Summary

6. Constructing classes and interfaces

6.1. Defining a simple class

6.2. Constructing classes and interfaces

6.3. Creating constant classes with final, unchanging variables

6.4. Summary

7. Extending classes and interfaces

7.1. Extending classes with inheritance

7.2. Everything is an object

7.3. Introducing the dynamic type

7.4. Summary

8. Collections of richer classes

8.1. Working with collections of data

8.2. Building your own generic classes

8.3. Operator overloading

8.4. Summary

9. Asynchronous programming with callbacks and futures

9.1. Why web apps should be asynchronous

9.2. Using callbacks with async programming

9.3. Introducing the Future and Completer pair

9.4. Unit-testing async APIs

9.5. Summary

Part 3 Client-side Dart apps

10. Building a Dart web app

10.1. A single-page web app design

10.2. Building a UI with dart:html

10.3. Handling browser events with dart:html

10.4. Summary

11. Navigating offline data

11.1. Integrating navigation with the browser

11.2. Using browser cookies to enhance user experience

11.3. Persisting data offline with Web Storage

11.4. Summary

12. Communicating with other systems and languages

12.1. Communicating with JavaScript

12.2. Communicating with external servers

12.3. Building installable, server-less browser apps

12.4. Summary

Part 4 Server-side Dart

13. Server interaction with files and HTTP

13.1. Running server-side Dart scripts

13.2. Serving browser HTTP requests

13.3. Serving clients with a RESTful API

13.4. Summary

14. Sending, syncing, and storing data

14.1. Serving DartExpense from the server

14.2. Using web sockets for two-way communication

14.3. Storing data with HttpClient and CouchDB

14.4. Summary

15. Concurrency with isolates

15.1. Using isolates as units of work

15.2. Loading code dynamically

15.3. Spawning multiple workers

15.4. Summary

Appendix A: Core language reference

Appendix B: Defining classes and libraries


© 2014 Manning Publications Co.

About the Technology

Dart is a web programming language developed by Google. It has modern OO features, just like Java or C#, while keeping JavaScript's dynamic and functional characteristics. Dart applications are "transpiled" to JavaScript, and they run natively in Dart-enabled browsers. With production-quality libraries and tools, Dart operates on both the client and the server for a consistent development process.

About the book

Dart in Action introduces the Dart language and teaches you to use it in browser-based, desktop, and mobile applications. Not just a language tutorial, this book gets quickly into the nitty-gritty of using Dart. Most questions that pop up while you're reading are answered on the spot! OO newbies will appreciate the gentle pace in the early chapters. Later chapters take a test-first approach and encourage you to try Dart hands-on.

Whether you're experienced with JavaScript, or come from a traditional object-orientated language background, this book will make you productive using this exciting new language.

What's inside

  • Dart from the ground up
  • Numerous code samples and diagrams
  • Creating single-page web apps
  • Transitioning from Java, C#, or JavaScript
  • Running Dart in the browser and on the server

About the reader

To benefit from this book you'll need experience with HTML and JavaScript; Java or C# background is helpful but not required.

About the author

Chris Buckett builds enterprise-scale web applications. He is an active contributor to the dartlang list.

combo $44.99 pBook + eBook + liveBook
eBook $35.99 pdf + ePub + kindle + liveBook

FREE domestic shipping on three or more pBooks

A compelling and captivating book about learning and working with Dart as an alternative to JavaScript.

Glen Stokol, Oracle Corporation

Puts the future of web apps in the palm your hand.

Rokesh Jankie, QAFE, Inc.

The perfect guide for a beautiful language.

Willhelm Lehman, Websense, Inc.