SharedPreferencesStorageManager class
SharedPreferences implementation of LocalStorageManager Uses flutter_shared_utilities for safe serialization
- Implemented types
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
-
clearAll(
) → Future< StorageResult< bool> > -
Clears all data from storage with detailed error handling
Returns StorageResult with success/failure information
override
-
containsKey(
String key) → StorageResult< bool> -
Checks if a key exists in storage with error handling
Returns StorageResult with existence information
override
-
getAllKeys(
) → StorageResult< List< String> > -
Gets all keys currently stored
Returns StorageResult with keys or failure information
override
-
getAllValues(
) → StorageResult< Map< String, Object?> > -
Gets all key-value pairs as a map
Returns StorageResult with map or failure information
override
-
getKeysMatching(
String pattern) → StorageResult< List< String> > -
Gets keys that match a pattern (if supported by implementation)
Returns StorageResult with matching keys or failure information
override
-
getMultipleValues<
T> (List< String> keys) → StorageResult<Map< String, T?> > -
Gets multiple values by their keys
Returns StorageResult with map or failure information
override
-
getStorageSize(
) → StorageResult< int> -
Gets the number of stored items
Returns StorageResult with size or failure information
override
-
getValue<
T> (String key) → StorageResult< T?> -
Retrieves a value from storage with detailed error handling
Returns StorageResult with value or failure information
override
-
getValueWithDefault<
T> (String key, {required T defaultValue}) → T -
Retrieves a value from storage with a default fallback
Returns the value if it exists, otherwise returns the provided default
override
-
hasValue(
String key) → StorageResult< bool> -
Checks if a key exists and has a non-null value
Returns StorageResult with value existence or failure information
override
-
isEmpty(
) → StorageResult< bool> -
Checks if storage is empty
Returns StorageResult with empty status or failure information
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeMultipleValues(
List< String> keys) → Future<StorageResult< bool> > -
Removes multiple keys in a single operation
Returns StorageResult with success/failure information
override
-
removeValue(
String key) → Future< StorageResult< bool> > -
Removes a value from storage with detailed error handling
Returns StorageResult with success/failure information
override
-
setMultipleValues(
Map< String, Object?> values) → Future<StorageResult< bool> > -
Sets multiple key-value pairs in a single operation
Returns StorageResult with success/failure information
override
-
setValue<
T> (String key, T value) → Future< StorageResult< bool> > -
Saves a value to storage with type safety and detailed error handling
Returns StorageResult with success/failure information
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
) → Future< SharedPreferencesStorageManager> - Creates a new instance of SharedPreferencesStorageManager with properly initialized SharedPreferences