Boxx class

Class to handle all local storage

Constructors

Boxx({required EncryptionMode? mode, String? encryptionKey})
Constructor for Boxx This will initialize the BoxxInterface based on the platform and encryption mode It uses the BoxxFactory to get the correct implementation for the current platform The encryptionKey is optional and can be used for AES or Fernet encryption

Properties

encryptionKey String?
final
hashCode int
The hash code for this object.
no setterinherited
mode EncryptionMode?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() Future<void>
Clear all data from local storage This will delete all data stored in the local storage
decrypt(String data) String
Decrypt data using AES/Fernet This will decrypt the data using AES decryption with the provided encryption key
delete(String key) Future<void>
Delete from local storage This will delete the value from the local storage with the key If the key does not exist, it will do nothing
encrypt(String data) String
Encrypt data using AES/Fernet This will encrypt the data using AES encryption with the provided encryption key
exists(String key) Future<bool>
Check if a key exists in local storage This will return true if the key exists, false otherwise
get(String key) Future
Get from local storage This will return the value stored in the local storage with the key If the key does not exist, it will return null
initialize() Future<void>
Initialize the storage This must be called before any other operation
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(String key, dynamic value) Future<void>
Save to local storage This will save the value to the local storage with the key If the key already exists, it will overwrite the value
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited