v1.4.0
localstore
JSONファイルベースのストレージパッケージは、シンプルなNoSQLデータベース用の永続的なリポジトリを提供します。
194いいね 227030日間ダウンロード140Pub ポイント
AndroidiOSWebmacOSWindowsLinux
chuyentt/localstore open-source repository details.
{"sdk":"flutter"}^1.8.2^2.0.11{"sdk":"flutter"}^3.0.2^5.0.0^3.0.0^2.1.2^2.1.8以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。
Between SQL or NoSQL, there's no one best database, there's the right database for your specific project. Localstore is a JSON file-based storage package (localstorage) provides a persistent repository for simple NoSQL database.
| Localstore (NoSQL) | SQLite (SQL) | |
|---|---|---|
| Data format | File path (collection) | Table |
| Data item | JSON Document (doc) | Record / Row |
| Scalability | Horizontal | Limited vertical |
| Organization | Schema-less | Fixed schema |
Localstore UML diagram
WidgetsFlutterBinding.ensureInitialized(); in main() before calling runApp():void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(MyApp());
}
import 'package:localstore/localstore.dart';import 'package:flutter/material.dart';
import 'package:localstore/localstore.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(MyApp());
}
Localstorefinal db = Localstore.instance;
or using anywhere in your project.
// gets new id
final id = db.collection('todos').doc().id;
// save the item
db.collection('todos').doc(id).set({
'title': 'Todo title',
'done': false
});
final data = await db.collection('todos').doc(id).get();
db.collection('todos').doc(id).delete();
final items = await db.collection('todos').get();
final stream = db.collection('todos').stream;
Please file feature requests and bugs at the issue tracker.