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();
final value = prefs.get(key);
return (value is T) ? value : null;
}