v1.4.0
localstore
JSON 파일 기반의 저장 패키지는 간단한 NoSQL 데이터베이스를 위한 지속적인 저장소를 제공합니다.
194좋아요 2.3천30일 다운로드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.