containsKeyF static method
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;
}