v1.4.0
localstore
A JSON file-based storage package provides a persistent repository for simple NoSQL database.
194Likes 4K30-day downloads140Pub points
AndroidiOSWebmacOSWindowsLinux
chuyentt/localstore open-source repository details.
English project snapshot. Visit GitHub for the latest content.
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 |
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.
Dependency list 9 items
{"sdk":"flutter"}^1.8.2^2.0.11{"sdk":"flutter"}^3.0.2^5.0.0^3.0.0^2.1.2^2.1.8Start with your use case, compare repository activity, and check the original project before adopting it.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗