setBool method
Stores a boolean value in SharedPreferences.
key: The key for the boolean value to be stored.value: The boolean value to store.
Implementation
Future<void> setBool(String key, bool value) async {
await ensureSharedPrefIsInitialized();
if (boolKeys.containsKey(key)) {
await prefs.setBool(key, value);
} else {
throw Exception("Key '$key' is not implemented as bool.");
}
}