Web SQL
Web SQL was introduced by Apple and is based on a free database SQLite. It will be discontinued very soon, and I intend to add it here only to show you how it could be used and how we can migrate to other advanced techniques without glitches. In the following code, we created a new shopping_cart_web_sql
project as a copy of the project from the Web Storage section and added WebSQLStorageManager
into the StorageManager
class:
abstract class StorageManager { factory StorageManager() { if (WebSQLStorageManager.supported) { return new WebSQLStorageManager(); } else if (WebStorageManager.supported) { return new WebStorageManager(); } else { return new CookieStorageManager(); } } Future<String> getItem(key); Future setItem(key, value); Future ...
Get Dart: Scalable Application Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.