read<T> static method

T? read<T>(
  1. String key
)

Retrieves a value from storage.

Implementation

static T? read<T>(String key) {
  if (T == String) return _prefs?.getString(key) as T?;
  if (T == bool) return _prefs?.getBool(key) as T?;
  if (T == int) return _prefs?.getInt(key) as T?;
  return null;
}