StorageHelper class

Helper class to handle local storage, dynamically switching between standard SharedPreferences and encrypted FlutterSecureStorage based on configuration.

Constructors

StorageHelper({required bool useSecure})
Creates a StorageHelper with the configured useSecure flag.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
useSecure bool
Whether to use secure encrypted storage (Keychain/Keystore) to store secrets.
final

Methods

getRecoveryCodes() Future<List<String>>
Deserializes and retrieves the saved list of backup recovery codes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readBool(String key, {bool defaultValue = false}) Future<bool>
Reads a boolean value from the store under the given key.
readString(String key) Future<String?>
Reads a string value from the store under the given key.
saveRecoveryCodes(List<String> codes) Future<void>
Serializes and saves the list of backup codes.
toString() String
A string representation of this object.
inherited
useRecoveryCode(String code) Future<bool>
Validates a single recovery code, and if correct, marks it as used by removing it from the stored list.
writeBool(String key, bool value) Future<void>
Writes a boolean value to the store under the given key.
writeString(String key, String value) Future<void>
Writes a string value to the store under the given key.

Operators

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