containsKeyF static method

Future<bool> containsKeyF(
  1. String? key
)

Returns true if persistent storage the contains the given key. Return null if key is null

Implementation

static Future<bool> containsKeyF(String? key) async {
  bool contains;
  if (key == null) {
    return false;
  }
  if (_prefsInstance == null) {
    final prefs = await instance;
    contains = prefs.containsKey(key);
  } else {
    // SharedPreferences is available. Ignore init() function.
    _initCalled = true;
    contains = _prefsInstance!.containsKey(key);
  }
  return contains;
}