Contents at a Glance
Contents
About the Authors
About the Technical Reviewer
Acknowledgments
Introduction
Chapter 1: Dart’s Flightpath So Far
What is Dart?
Advantages to Using Dart
Dart’s Origins
Converting From Other Programming Languages
Dart Names are Simpler and More Structured
Searching for DOM Elements is Easier
Dart Has Real Data Collections
Constructors to Create New DOM Elements
Dart Improves and Unifies the Events System
Say Goodbye to Vendor Prefixes
Future-Based APIs
Libraries
Cross-Browser Consistency
Cascaded DOM Construction
Why Dart is Perfect for Web Development
Summary
Part I: Getting Started
Chapter 2: Setting up Dart Correctly
Downloading and Installing the Software
Setting Up a Previous Version of Dart Editor
Dart Editor and the Software Development Environment
Opening and Running an Example
Creating Your First Application
Creating a Web Application
Creating Command-Line Applications
Summary
Part II: Dart Tools
Chapter 3: Making the Most of the Dart Editor
The Dart Editor in Detail
Opening Some Examples
Creating Applications
Dart Editor Options and Main Views
Preferences and Views
Outline View Additional Buttons
Problems View Additional Buttons
Setting Up the Views
Dart Editor Preferences
Running Applications
How Does this Sample Application Run?
Advanced Examples
Debugging Applications
Inspecting the SDK
Summary
Chapter 4: Using Pub and dart2js to Compile Applications to JavaScript
Reviewing the Compliation Process
Pub build
dart2js
Pub Serve
Summary
Chapter 5: Application Launches
Manage Launches
Dart Command-Line Launch
Dartium Launch
Chrome App Launch
Browser Launch
Android Mobile Launch
Summary
Chapter 6: Using the Dart Pub Package Manager
What is Pub?
Digging Deeper
Working With Commands and Packages
Pub Build
Pub Cache
Pub Deps
Pub Get
Pub Global
Pub Publish
Pub Run
Pub Serve
Pub Upgrade
Pub Uploader
Pub Downgrade
Pub help
Pub version
Additional Pub Commands
Summary
Chapter 7: Optimizing for Dart VM and Dartium
Dart Virtual Machine
Dartium
Checked Mode
Summary
Chapter 8: Cleaning up with Dart Formatter
Dart Formatter
Summary
Chapter 9: Generating Dart Code Documentation
docgen
DocGen Options
Summary
Chapter 10: Monitoring Your Applications with Observatory
Observatory
Observatory and Command-Line Applications
Observatory and Web Applications
Summary
Part III: The Dart Language: Basics
Chapter 11: The Dart Comment System
Comments Overview
Inline Comments
Block Comments
Documentation Comments
Markdown
Links
Block Styles
Inline Styles
Summary
Chapter 12: Understanding Operators and Expressions
An Introduction to Dart Operators
Operator Types
Arithmetic
Equality and Relational
Type Test
Assignment
Conditional
Bit
Others
An Introduction to Expressions
Conditional
Logical
Bit
Equality
Relational
Bitwise
Addition
Multiplication
Pre-Expressions and Post-Expressions
Assignment
How to Create Your Own Operators
Summary
Chapter 13: Mastering Dart’s Variables and Data Types
An Introduction to Variables and Data Types
Variables Definition
Types of Variables: Final and Const
Data Types
Numbers
Working with Numbers in Dart
dart:math Library
Random Numbers
Strings
Working with Strings
Regular Expressions
Brackets
Metacharacters
Booleans
Working with Bool Values
Lists
Working with the List Class
Iterable
Sets
Maps
Date and Time
Summary
Chapter 14: Flow Control Statements
If and Else
Switch Statement
For Loop
While Loop
Summary
Chapter 15: Working with Functions
Defining Functions
Positional Optional Parameters
Named Optional Parameters
Default Values
Return Values
Recursive Functions
Summary
Chapter 16: A Syntax Summary and Cheat Sheet
Part IV: The Dart Language: Advanced
Chapter 17: Processing Exceptions and Error Control
Exceptions and Error Control
Exceptions Types
Error Types
Exceptions and Error Definitions
Summary
Chapter 18: Understanding Dart Classes
Instance Variables
Constructors
Methods
Inheritance
Variables and Static Methods
Summary
Chapter 19: Implicit Interfaces and Abstract Classes
Summary
Chapter 20: Implementing Generics and Typedefs
Generics
Typedef
Summary
Chapter 21: Using Dart’s Libraries
Using Libraries
Creating Libraries with Multiple Files
Re-exporting Libraries
Summary
Chapter 22: Leveraging Isolates for Concurrency and Multi-Processing
Summary
Chapter 23: Asynchronous Programming with Dart
What is Asynchronous Programming?
Future
Working with Future
Stream
Working with Stream
Creating Asynchronous Functions
Summary
Chapter 24: An Advanced Syntax Summary
Exceptions and Errors
Classes
Part V: Dart and Other Web Technologies
Chapter 25: Integrating Dart and HTML5
Working with HTML
Event Management
Summary
Chapter 26: Integrating Dart and CSS
Working with CSS
Visual Effects
FadeIn and FadeOut
Flashing Effect
Expand and Collapse Items
Summary
Part VI: Dart and the Web Server
Chapter 27: Combining Web Services with Dart
Asynchronous HTTP Requests with Dart
Using JSON in Dart
Summary
Chapter 28: Dart on the Server Side
The I/O Dart Library
Creating a Server Application
Handling Requests
Working with Processes
Sockets
Summary
Part VII: Dart’s Future
Chapter 29: Implementing Design Patterns and Creating Web Components
Web Components
Polymer.dart
What is the Shadow DOM?
Working with Polymer.dart
Summary
Chapter 30: Developing a Dart App
Designing the Application
Creating the Application
Coding the Application
Summary
Index