saveValue method

void saveValue(
  1. String key,
  2. dynamic value
)

Implementation

void saveValue(String key, dynamic value) async{
  try {
    var jsonValue = jsonEncode(value);
    await SharedPreferences.getInstance().then((value) => value.setString(key, jsonValue));
  }catch(err){
    Log(_tag).e("Saving Object Error : $err");
  }
}