containKey static method

Future<bool> containKey(
  1. String key
)

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);
}