getBool static method

Future<bool> getBool(
  1. String key
)

Implementation

static Future<bool> getBool(String key) async {
  final SharedPreferences prefs = await SharedPreferences.getInstance();
  final bool? value = prefs.getBool(key);
  if (value != null) {
    return value;
  } else {
    return false;
  }
}