JsonCacheLocalStorage class final
Implementation on top of the LocalStorage package.
Before using it, don't forget to call:
WidgetsFlutterBinding.ensureInitialized();
await initLocalStorage();
See: local storage
- Implemented types
Constructors
- JsonCacheLocalStorage([LocalStorage? customLocalStorage])
- Implementation on top of the LocalStorage package.
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< void> -
Frees up storage space — deletes all keys and values.
override
-
contains(
String key) → Future< bool> -
Checks for cached data at
key
.override -
keys(
) → Future< UnmodifiableListView< String> > -
The cache keys.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
String key, Map< String, dynamic> value) → Future<void> -
It either updates the data found at
key
withvalue
or, if there is no previous data atkey
, creates a new cache line atkey
withvalue
.override -
remove(
String key) → Future< void> -
Removes the cached data located at
key
.override -
toString(
) → String -
A string representation of this object.
inherited
-
value(
String key) → Future< Map< String, dynamic> ?> -
Retrieves the data located at
key
ornull
if a cache miss occurs.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited