readJson<T> static method
Read a JSON value from the local storage
Implementation
static Future<dynamic> readJson<T>(String key, {dynamic defaultValue}) async {
String? data = await manager().read(key: key);
if (data == null) {
return defaultValue;
}
try {
return jsonDecode(data);
} on Exception catch (e) {
NyLogger.error(e.toString());
return null;
}
}