getJson static method

Future getJson({
  1. required String key,
})

Implementation

static Future getJson({required String key}) async {
  final SharedPreferences sharedPreferences =
      await SharedPreferences.getInstance();
  dynamic cache = sharedPreferences.getString(key);
  Map<String, dynamic> jsonMapCache =
      jsonDecode(cache) as Map<String, dynamic>;
  return jsonMapCache;
}