lokalsetor
Flutter local database based on sharedpreference
You can try it on lokalsetor.lamun.my.id.
Usage
import 'package:lokalsetor/lokalsetor.dart';
...
Future<void> main() async {
PotretDokumen dok = await LokalSetor.instansi.koleksi('koleksiID').dok('dokumenID').ambil();
...
...
Koleksi
Koleksi is a place to store several Dokumen in it we can add Dokumen and retrieve all Dokumen in the Koleksi
PotretKueri
PotretKueri() - return when get all Dokumen on Koleksi
.doks- will return theDokumenthat are in theKoleksi.size- will return the length of theDokumenthat are in theKoleksi
For example:
...
PotretKueri kueri = await LokalSetor.instansi.koleksi('koleksiID').ambil();
int size = kueri.size;
List<PotretDokumen>? doks = kueri.doks;
...
PotretDokumen
PotretDokumen() - return when get single Dokumen
-
.id- will return theDokumenID -
.ada- will return theDokumenis exists? -
.jalan- will return theDokumenpath -
.referensi- will return theDokumenreference in the form of ReferensiDokumen -
.ambil()- to getDokumen -
.data()- will return the data ofDokumenin the form of Map<String, dynamic> -
.setel(data)- to reformatDokumento a new format
For example:
...
PotretDokumen dok = await LokalSetor.instansi.dok(jalanDok).ambil();
if (dok.ada) {
print(dok.id);
Map<String, dynamic> data = dok.data();
}
...