boxx 0.1.2
boxx: ^0.1.2 copied to clipboard
Boxx is your ultimate key-value storage plugin with built-in encryption
example/README.md
Example of usage boxx #
Storage Without Encryption
late Boxx box;
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
initBox();
}
initBox() {
box = Boxx(mode: EncryptionMode.none);
}
Storage With Encryption
late Boxx box;
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await initBox();
}
initBox() {
box = Boxx(mode: EncryptionMode.aes,encryptionKey: 'xxxxxxxx');
}
Usage #
Delete
box.boxx.delete('UserData');
Get
final contents = await box.boxx.get('UserData');
Put
box.boxx.put('UserData', response.body);
AES encrption
String t1 = box.aes.encryptAES('Hello World', box.encryptionKey!);
debugPrint(t1);
String t2 = box.aes.decryptAES(t1, box.encryptionKey!);
debugPrint(t2);
Fernet encryption
String t3 = box.fernet.encryptFernet('Hello World', box.encryptionKey!);
debugPrint(t3);
String t4 = box.fernet.decryptFernet(t1, box.encryptionKey!);
debugPrint(t4);