Chapter 10. Building a Dart web app

 

This chapter covers

  • The structure of a single-page web app
  • Building dynamic views with dart:html elements
  • Handling browser events with Dart

Dart’s primary use is building complex web apps. A web app typically comprises a single web page that loads in the browser and provides a host for the application’s code. This application source code is responsible for building the user interface, providing methods for navigating around the application, and storing the user’s data by either sending it to the server or storing it locally.

When building a web app in Dart, it’s good practice to build it working offline first. Working offline has a number of benefits, both for you as the developer and for the end user. When you build a web app offline first, you provide some mock injected data that will ultimately be replaced by a combination of local, client-side storage (supported by HTML5 APIs) and server-side data persistence. This setup lets you write the client-side app in Dart without needing a server component or database up and running, thereby reducing debug times and aiding the ability to unittest your 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

sitemap