Book Image

Learning Dart, Second Edition - Second Edition

By : Ivo Balbaert
Book Image

Learning Dart, Second Edition - Second Edition

By: Ivo Balbaert

Overview of this book

Table of Contents (18 chapters)
Learning Dart Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Using IndexedDB with Dart


IndexedDB is a transactional database system like a SQL-based RDBMS. However, while the latter uses tables with fixed columns, IndexedDB is a JavaScript-based object-oriented database. IndexedDB lets you store and retrieve objects that are indexed with a key. You need to specify the database schema, open a connection to your database, and retrieve and update the data within a series of transactions. Operations in IndexedDB are done asynchronously, so as to not block the rest of the application's running.

We will learn how to work with IndexedDB and JSON web services through the indexed_db_spirals project (https://github.com/dzenanr/indexed_db_spirals), which is a todo app like the ones we've built in the previous chapters. However, this stores its data in IndexedDB. Get a copy of the code with a git clone:

https://github.com/dzenanr/indexed_db_spirals.git.

Spiral s00

In this spiral, the todo tasks can be entered. They are stored in IndexedDB. The following is a screenshot...