get static method

Object? get(
  1. String? key
)

Reads a value of any type from persistent storage. Return null if key is null.

Implementation

static Object? get(String? key) {
  if (key == null) {
    return null;
  }
  assert(_initCalled,
      'Prefs.init() must be called first in an initState() preferably!');
  assert(_prefsInstance != null,
      'Maybe call Prefs.getF(key) instead. SharedPreferences not ready yet!');
  return _prefsInstance?.get(key);
}