getData<T> static method
Get the stored data with key
.
Implementation
static Future<T?> getData<T>({required String key}) async {
final SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.reload();
final Object? data = prefs.get(_kPrefsKeyPrefix + key);
return (data is T) ? data : null;
}