getBool method

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

Implementation

Future<bool?> getBool({
  required String key,
  bool defaultValue = false,
}) async {
  try {
    return Database.getSharedPreferences().getBool(key) ?? defaultValue;
  } catch (_) {}

  return defaultValue;
}