IVaultStorage class abstract
Defines the contract for a comprehensive vault storage.
This interface specifies the capabilities for both key-value storage and secure
file storage. It is designed to be implemented by a service that can handle
sensitive and non-sensitive data, with clear separation between the two.
The use of fpdart's Either type ensures robust, type-safe error handling.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
BoxType box) → Future< Either< StorageError, void> > - Clears all data from the specified Hive box.
-
delete(
BoxType box, String key) → Future< Either< StorageError, void> > -
Deletes a value from the specified Hive box by its
key. -
deleteNormalFile(
{required Map< String, dynamic> fileMetadata, bool? isWeb}) → Future<Either< StorageError, Unit> > -
Deletes a normal file from storage using its
fileMetadata. -
deleteSecureFile(
{required Map< String, dynamic> fileMetadata, bool? isWeb}) → Future<Either< StorageError, Unit> > -
Deletes a secure file from storage using its
fileMetadata. -
dispose(
) → Future< Either< StorageError, Unit> > - Disposes of all resources used by the vault storage.
-
get<
T> (BoxType box, String key) → Future< Either< StorageError, T?> > -
Retrieves a value from the specified Hive box by its
key. -
getNormalFile(
{required Map< String, dynamic> fileMetadata, bool? isWeb}) → Future<Either< StorageError, Uint8List> > -
Retrieves a normal file using its
fileMetadata. -
getSecureFile(
{required Map< String, dynamic> fileMetadata, bool? isWeb}) → Future<Either< StorageError, Uint8List> > -
Retrieves and decrypts a secure file using its
fileMetadata. -
init(
) → Future< Either< StorageError, Unit> > - Initializes the vault storage.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
saveNormalFile(
{required Uint8List fileBytes, required String fileExtension, bool? isWeb}) → Future< Either< StorageError, Map< >String, dynamic> > - Saves a file's bytes without encryption.
-
saveSecureFile(
{required Uint8List fileBytes, required String fileExtension, bool? isWeb}) → Future< Either< StorageError, Map< >String, dynamic> > - Encrypts and saves a file's bytes securely.
-
set<
T> (BoxType box, String key, T value) → Future< Either< StorageError, void> > -
Saves a
valuein the specified Hive box with the givenkey. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited