setBool method

Future<void> setBool(
  1. String key,
  2. bool value
)

Saves a boolean value to the cache and platform.

Throws an ArgumentError if key is not in this instance's filter.

Implementation

Future<void> setBool(String key, bool value) async {
  if (!_isValidKey(key)) {
    throw ArgumentError(
        '$key is not included in the PreferencesFilter allowlist');
  }
  _cache[key] = value;
  return _platformMethods.setBool(key, value);
}