Book Image

Dart By Example

By : David Mitchell
Book Image

Dart By Example

By: David Mitchell

Overview of this book

Table of Contents (17 chapters)
Dart By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Consuming application


We now have two parts of the solution: the collected data and the web service to publish it. The next step is to build a client application that will talk to the web service. Initially, we will have a details grid view (or table for the HTML-minded) of the ten latest incoming data.

Rather than having the user update the page, the screen will auto-update periodically with the latest earthquake information.

Packaging the grid

The grid display may be useful for other applications, so it will be split off into its own project as the package webgridview, as shown here:

name: 'GridViewer'
version: 0.0.1
description: A grid viewer for GeoJSON data.
environment:
  sdk: '>=1.0.0 <2.0.0'
dependencies:
  browser: '>=0.10.0 <0.11.0'
  intl: any
  webgridview:
    path: ../webgridview/

The package can be referenced in the pubspec.yaml as a local package.

Initiating the real-time updates

The main function in main.dart will perform an initial update of the grid and then initiate...