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 theDokumen
that are in theKoleksi
.size
- will return the length of theDokumen
that 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 theDokumen
ID -
.ada
- will return theDokumen
is exists? -
.jalan
- will return theDokumen
path -
.referensi
- will return theDokumen
reference in the form of ReferensiDokumen -
.ambil()
- to getDokumen
-
.data()
- will return the data ofDokumen
in the form of Map<String, dynamic> -
.setel(data)
- to reformatDokumen
to 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();
}
...