getDataFromAsyncStorage method

Future getDataFromAsyncStorage(
  1. String key
)

Implementation

Future<dynamic> getDataFromAsyncStorage(String key) async {
  try {
    final jsonValue = await SharedPreferences.getInstance()
        .then((prefs) => prefs.getString(key));
    return jsonValue != null ? json.decode(jsonValue) : null;
  } catch (e) {
    debugPrint(e.toString());
  }
}