getJson method Null safety
- String key
Implementation
Map<String, dynamic>? getJson(String key) {
String? strValue = _prefs.getString(key);
if (strValue == null) {
return null;
} else {
return json.decode(strValue);
}
}
Map<String, dynamic>? getJson(String key) {
String? strValue = _prefs.getString(key);
if (strValue == null) {
return null;
} else {
return json.decode(strValue);
}
}