getBool function

  1. @Deprecated('Use getBoolAsync instead without using await')
Future<bool> getBool(
  1. String key, {
  2. dynamic defaultValue = false,
})

Returns a Bool if exists in SharedPref

Implementation

@Deprecated('Use getBoolAsync instead without using await')
Future<bool> getBool(String key, {defaultValue = false}) async {
  return await getSharedPref().then((pref) {
    return pref.getBool(key) ?? defaultValue;
  });
}