Free Sample
+ Collection

Learning Dart

Dzenan Ridjanovic, Ivo Balbaert

Dart is the programming language developed by Google that offers a new level of simple versatility. Learn all the essentials of Dart web development in this brilliant tutorial that takes you from beginner to pro.
RRP $35.99
RRP $59.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849697422
Paperback388 pages

About This Book

  • Develop apps for the Web using Dart and HTML5
  • Build powerful HTML5 forms, validate and store data in local storage, and use web components to build your own user interface
  • Make games by drawing and integrate audio and video in the browser
  • Learn how to develop an application with the help of a model-driven and fast-paced approach

Who This Book Is For

If you want to become a web developer, or perhaps you already are a web developer but you want to add Dart to your tool belt, then this book is for you. This book assumes that you have at least some knowledge of HTML and how web applications work. Some previous programming experience, preferably in a modern language like C#, Java, Python, Ruby, or JavaScript, will also give you a head start. You can also work with Dart on your preferred platform, be it Linux, Mac OS X, or Windows.

Table of Contents

Chapter 1: Dart – A Modern Web Programming Language
What is Dart?
Dart is a perfect fit for HTML5
Getting started with Dart
Getting a view on the Dart tool chain
A bird's eye view on Dart
Making a todo list with Dart
Chapter 2: Getting to Work with Dart
Variables – to type or not to type
Built-in types and their methods
Documenting your programs
Changing the execution flow of a program
Using functions in Dart
Recognizing and catching errors and exceptions
Chapter 3: Structuring Code with Classes and Libraries
A touch of class – how to use classes and objects
Chapter 4: Modeling Web Applications with Model Concepts and Dartlero
A short introduction to Git and GitHub
What a model is and why we need it in programming
Model concepts – a graphical design tool for our models
Dartlero – a simple domain model framework
An example of using Dartlero
The categories and links application
Chapter 5: Handling the DOM in a New Way
Finding elements and changing their attributes
Creating and removing elements
Handling events
Manipulating the style of page elements
Animating a game
Chapter 6: Combining HTML5 Forms with Dart
Spiral 1 – the power of HTML5 forms
Spiral 2 – how to validate data with Dart
Spiral 3 – how to store data in local storage
Spiral 4 – reading and showing data
Spiral 5 – changing and updating data
Spiral 6 – working with a list of bank accounts
Chapter 7: Building Games with HTML5 and Dart
The model for the memory game
Spiral 1 – drawing the board
Spiral 2 – drawing cells
Spiral 3 – coloring the cells
Spiral 4 – implementing the rules
Spiral 5 – game logic (bringing in the time element)
Spiral 6 – some finishing touches
Spiral 7 – using images
Adding audio to a web page
Using an audio library – Collision clones
Adding video to a web page
Chapter 8: Developing Business Applications with Polymer Web Components
How web components change web development
Web components with Polymer.dart
Two-way data binding in Polymer.dart
Creating the polymer_links project
Using Polymer for the category links project
Applying web components to the project tasks app
Chapter 9: Modeling More Complex Applications with Dartling
The Dartling domain modeling framework
Design of the Travel Impressions model in spirals
Generating Travel Impressions code from the model
Initializing the Travel Impressions model with Data
Testing the Travel Impressions model
Defining and using the MVC pattern
The TodoMVC app
Chapter 10: MVC Web and UI Frameworks in Dart – An Overview
Dart Web Toolkit (DWT)
Dart widgets
HTML components
Rikulo UI
Flash Professional CC – toolkit for Dart
Chapter 11: Local Data and Client-Server Communication
The options for browser storage
Asynchronous calls and Futures
Using IndexedDB with Dart
Using Lawndart
A Dart web server
Using JSON web services
Chapter 12: Data-driven Web Applications with MySQL and MongoDB
Database drivers for Dart
Storing todo data in MySQL
Dartlero tasks – a many-to-many model in MySQL
MongoDB – a NoSQL database
Using the mongo_dart driver to store the todo data in MongoDB

What You Will Learn

  • Structure your code using functions, classes, generics, packages, and libraries
  • Model web applications with domain model frameworks
  • Use the power of modern browsers for processing and storing data
  • Build web games in HTML5 and code them in Dart
  • Get an overview of the available UI and MVC frameworks to use with Dart
  • Build the complex UI needed in business applications with Dart's Polymer framework based on web components
  • Store your data with MongoDB, one of the most popular NoSQL databases, and access your MongoDB databases from Dart

In Detail

Dart is a new open source programming language for the Web. Developed by Google, Dart is gaining popularity and has a steadily growing community. It is a single language for both client and server that can be used with a wide range of devices, including phones, tablets, laptops, and servers. It encompasses the lessons that have been learned over the last two decades of web programming. Stop solving new challenges with the same old tools - let Dart show you a whole new way.

"Learning Dart" provides you with a thorough overview of this new open source programming language. It will guide you step-by-step through building games and business applications for the Web, taking advantage of the power behind a modern language combined with HTML5.

"Learning Dart" starts by exploring the Dart ecosystem. This is followed by two chapters that will show you everything you need to know about Dart's syntax and development principles. Throughout the rest of the book, you will apply this knowledge to advanced topics with the help of an example-based approach.

You will explore how to build web games using HTML5, how to integrate audio and video into your applications, and how to process and show data in HTML5 forms with Dart. The book also shows you how web components fit together with HTML5 and how to apply them in business web applications. You also learn how to store data on the client, how to communicate data between client and server with JSON, and how to store JSON data with MongoDB.

"Learning Dart" provides you with everything you need to know to start or enhance your career in web development.


Read More