boxx 0.0.8
boxx: ^0.0.8 copied to clipboard
Boxx is a lightweight and blazing fast key-value database written in pure Dart
example/README.md
Example of usage boxx #
Without Encryption
late Boxx box;
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await initBox();
}
initBox() async {
if (kIsWeb) {
box = Boxx(path: '');
} else {
final directory = await getApplicationDocumentsDirectory();
box = Boxx(path: directory.path);
}
}
With Encryption
late Boxx box;
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await initBox();
}
initBox() async {
if (kIsWeb) {
box = Boxx(path: '',encryptionKey: 'xxxxxxxx',mode: EncryptionMode.aes);
} else {
final directory = await getApplicationDocumentsDirectory();
box = Boxx(path: directory.path,encryptionKey: 'xxxxxxxx',mode: EncryptionMode.aes);
}
}
Usage #
Delete
box.boxx.delete('UserData');
Get
final contents = await box.boxx.get('UserData');
Put
box.boxx.put('UserData', response.body);