PlayxSecurePrefs class abstract

Wrapper for handling secure preferences to save and get preferences.

This class provides a secure storage solution for key-value pairs using FlutterSecureStorage. It supports storing and retrieving data of types String, int, double, and bool securely, with the data being encrypted and decrypted as needed.

The class includes methods for creating the secure storage instance, setting, getting, and removing preferences, and clearing all stored data. It also provides functionality to clear the secure storage on app reinstall.

Constructors

PlayxSecurePrefs()

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

securePrefs FlutterSecureStorage
Getter for the FlutterSecureStorage instance.
no setter

Static Methods

clear() Future<void>
Clears all data in the secure preferences.
clearOnReinstall() Future<void>
Clears Secure Storage on Reinstall.
create({PlayxSecurePrefsSettings securePrefsSettings = const PlayxSecurePrefsSettings()}) Future<FlutterSecureStorage>
Creates a new instance of FlutterSecureStorage with the given settings.
getBool(String key, {bool fallback = false}) Future<bool>
Retrieves the value associated with the given key as a bool.
getDouble(String key, {double fallback = -1}) Future<double>
Retrieves the value associated with the given key as a double.
getInt(String key, {int fallback = -1}) Future<int>
Retrieves the value associated with the given key as an int.
getString(String key, {String fallback = ''}) Future<String>
Retrieves the value associated with the given key as a String.
maybeGetBool(String key) Future<bool?>
Retrieves the value associated with the given key as a bool.
maybeGetDouble(String key) Future<double?>
Retrieves the value associated with the given key as a double.
maybeGetInt(String key) Future<int?>
Retrieves the value associated with the given key as an int.
maybeGetString(String key) Future<String?>
Retrieves the value associated with the given key as a String.
remove(String key) Future<void>
Removes the value associated with the given key.
setBool(String key, bool value) Future<void>
Sets the value associated with the given key as a bool.
setDouble(String key, double value) Future<void>
Sets the value associated with the given key as a double.
setInt(String key, int value) Future<void>
Sets the value associated with the given key as an int.
setString(String key, String value) Future<void>
Sets the value associated with the given key as a String.