containKey static method
containKey Check if the key is exist
key
is the key of the shared preferences
Implementation
static Future<bool> containKey(String key) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
return prefs.containsKey(key);
}