setJson static method

Future setJson({
  1. required String key,
  2. required Map<String, dynamic> value,
})

Implementation

static Future setJson(
    {required String key, required Map<String, dynamic> value}) async {
  final SharedPreferences sharedPreferences =
      await SharedPreferences.getInstance();
  Map<String, dynamic> jsonMap = value;
  await sharedPreferences.setString(key, jsonEncode(jsonMap));
}