setInt method

Future<void> setInt(
  1. String key,
  2. int value
)

Saves an integer value to the cache and platform.

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

Implementation

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