retrieve method
Implementation
dynamic retrieve(String key) async {
final SharedPreferences prefs = await SharedPreferences.getInstance();
final String? mydata = await prefs.getString(key);
var data = json.decode(mydata.toString());
return data;
}