static bool? getBool(String key, {bool? defaultValue}) { bool? value = sharedPreferences.getBool(key); return value ?? defaultValue; }