load method
load preference from local storage
Implementation
Future<void> load({bool forced = false}) async {
String debugPrefix = '$runtimeType.load()';
// Get Last save time
bool different = await _loadTime();
if (different || forced) {
// Get Preference
var pref = await getPref();
String jsonString = pref.getString(key) ?? '{}';
lazy.log('$debugPrefix:${jsonString.length}(byte)', forced: debugLogSave);
Map<String, dynamic> json = jsonDecode(jsonString);
lazy.log('$debugPrefix:json decoded', forced: debugLogSave);
noSave(() => fromJson(json));
} else {
lazy.log('$debugPrefix:not loaded, already up to date',
forced: debugLogSave);
}
}