Cache class
Cache is a 'shared_preferences' wrapper to store and retrieve cache String using keyPrefix.key as key format.
Provide index support
Constructors
Properties
- debugLog ↔ bool
-
getter/setter pair
- debugLogJson ↔ bool
-
enable/disable
fromJsondebug loggetter/setter pairinherited - debugLogJsonContent ↔ bool
-
enable/disable
fromJsondebug log with contentgetter/setter pairinherited - debugLogSave ↔ bool
-
enable/disable
savedebug loggetter/setter pairinherited - filenamePrefix ↔ String
-
Filename prefix when generating filename from
keyFilename.getter/setter pairinherited - hashCode → int
-
The hash code for this object.
no setterinherited
-
index
→ List<
String> -
Return index as List<String>
no setter
- key → String
-
keyfor saving preferencefinalinherited - keyFilename → dynamic
-
Generate filename from
keyno setterinherited - keyPrefix → String
-
keyPrefix is part of storage key.
final
- lastSaveTime → DateTime
-
Return preference last save time
no setterinherited
-
obj
↔ Map<
String, dynamic> -
JSON object holding all preferences
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- saveWaitAgainSeconds ↔ int
-
If save requested came in during wait,
number of seconds to wait again
getter/setter pairinherited
- saveWaitSeconds ↔ int
-
Number of seconds before actually trying to save
getter/setter pairinherited
Methods
-
clear(
) → Future - Remove all entries with keyPrefix from local storage
-
fromJson(
Map< String, dynamic> jsonObj, {bool debug = false}) → void -
Apply/Clone from json object
inherited
-
get(
String key) → Future< String> -
Get entry with
keyfrom local storage -
getPref(
) → FutureOr< SharedPreferences> -
Return cached
SharedPreferencesinstanceinherited -
load(
{bool forced = false}) → Future< void> -
load preference from local storage
inherited
-
noSave(
Function function) → void -
No-save wrapper
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
String key) → Future -
Remove entry with
keyfrom local storage -
save(
{DateTime? dateTime, Function? saved, String debugMsg = '', bool noSaveTime = false}) → Future< void> -
Save preference to local storage
inherited
-
set(
String key, String data) → Future -
Add/Set entry with
key=datain local storage -
toJson(
) → Map< String, dynamic> -
Return a deep copy json object
inherited
-
toString(
) → String -
Return pretty print json
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited