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
useSecureflag.
Properties
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
valuefrom the store under the givenkey. -
readString(
String key) → Future< String?> -
Reads a string
valuefrom the store under the givenkey. -
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
valueto the store under the givenkey. -
writeString(
String key, String value) → Future< void> -
Writes a string
valueto the store under the givenkey.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited