getBool static method

Future<bool> getBool(
  1. String key, {
  2. bool defaultValue = false,
})

Implementation

static Future<bool> getBool(String key, {bool defaultValue = false}) async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  return prefs.getBool(key) ?? defaultValue;
}