O'Reilly logo

Dart: Scalable Application Development by Ivo Balbaert, Sergey Akopkokhyants, Davy Mitchell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Lawndart to write offline web apps

What if the main requirement is that your app can work detached, providing universal offline key-value storage, whether IndexedDB is supported by your client's browsers or not? Then, Lawndart comes to the rescue.

Lawndart (https://github.com/sethladd/lawndart, but available via pub package) is not a new database, but rather a manager, which automatically chooses the best local storage mechanism available on the client. It was developed by Seth Ladd as a Dart rework of Lawnchair (http://brian.io/lawnchair/). You can see it in action in the project using_lawndart.

How to do it...

Import the Lawndart package by adding lawndart:any to your pubspec.yaml file. The following is the relevant code from the startup ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required