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