SharedPrefPro class

A production-ready local storage plugin for Flutter.

This plugin provides a simple key-value store for persistent data. It supports basic types like String, int, double, bool, List<String>, as well as Map and List for JSON storage.

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() Future<bool>
Removes all keys and values from the local storage.
containsKey(String key) Future<bool>
Returns true if the local storage contains the given key. Note: If the key exists but has expired, it will still return true until get or remove is called, or use isExpired to check.
get<T>(String key) Future<T?>
Retrieves a value of type T from the local storage.
getKeys() Future<Set<String>>
Returns all keys currently stored in the local storage (excluding internal expiry keys).
isExpired(String key) Future<bool>
Returns true if the given key has an expiration set and is now expired.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(String key) Future<bool>
Removes the value associated with key from the local storage. This also removes any associated expiration metadata.
save<T>(String key, T value, {Duration? expireIn}) Future<bool>
Saves a value of type T to the local storage.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance SharedPrefPro
The singleton instance of SharedPrefPro.
final