# shared_preferences_platform_interface 2.4.2

A common platform interface for the shared_preferences plugin.




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'shared_preferences_platform_interface:2.4.2'
```
Published: 2026-03-25T19:24:00.796272Z
Expected archive SHA-256: 649dc798a33931919ea356c4305c2d1f81619ea6e92244070b520187b5140ef9

Available in cache; verification: upstream_checksum
## Direct dependencies
- flutter: map[sdk:flutter]
- plugin_platform_interface: ^2.1.7

## Package README (untrusted upstream documentation)
# shared_preferences_platform_interface

A common platform interface for the [`shared_preferences`][1] plugin.

This interface allows platform-specific implementations of the `shared_preferences`
plugin, as well as the plugin itself, to ensure they are supporting the
same interface.

# Usage

To implement a new platform-specific implementation of `shared_preferences`, extend
[`SharedPreferencesPlatform`][2] and [`SharedPreferencesAsyncPlatform`][3] with
implementations that perform the platform-specific behaviors, and when you register
your plugin, set the default `SharedPreferencesStorePlatform` and
`SharedPreferencesAsyncPlatform` by calling the `SharedPreferencesPlatform.instance`
and `SharedPreferencesAsyncPlatform.instance` setters.

Please note that the plugin tooling only registers the native and/or Dart classes
listed in your package's `pubspec.yaml`, so if you intend to implement more than
one class, you will need to manually register the second class
(as can be seen in the Android and iOS implementations).

# Note on breaking changes

Strongly prefer non-breaking changes (such as adding a method to the interface)
over breaking changes for this package.

See https://flutter.dev/go/platform-interface-breaking-changes for a discussion
on why a less-clean interface is preferable to a breaking change.

[1]: ../shared_preferences
[2]: lib/shared_preferences_platform_interface.dart
[3]: lib/shared_preferences_async_platform_interface.dart
## Changelog
## 2.4.2

* Fixes dartdoc comments that accidentally used HTML.
* Updates minimum supported SDK version to Flutter 3.35/Dart 3.9.

## 2.4.1

* Adds comments about unsupported types.

## 2.4.0

* Adds `SharedPreferencesAsyncPlatform` API.
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.

## 2.3.2

* Updates minimum required plugin_platform_interface version to 2.1.7.
* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.

## 2.3.1

* Adds pub topics to package metadata.
* Updates minimum supported SDK version to Flutter 3.7/Dart 2.19.

## 2.3.0

* Adds `clearWithParameters` and `getAllWithParameters` methods.
* Deprecates `clearWithPrefix` and `getAllWithPrefix` methods.
* Updates minimum supported SDK version to Flutter 3.3/Dart 2.18.

## 2.2.0

* Adds `getAllWithPrefix` and `clearWithPrefix` method.
* Aligns Dart and Flutter SDK constraints.

## 2.1.1

* Updates links for the merge of flutter/plugins into flutter/packages.
* Updates minimum Flutter version to 3.0.

## 2.1.0

* Adopts `plugin_platform_interface`. As a result, `isMock` is deprecated in
  favor of the now-standard `MockPlatformInterfaceMixin`.

## 2.0.0

* Migrate to null safety.

## 1.0.5

* Update Flutter SDK constraint.

## 1.0.4

* Update lower bound of dart dependency to 2.1.0.

## 1.0.3

* Make the pedantic dev_dependency explicit.

## 1.0.2

* Adds a `shared_preferences_macos` package.

## 1.0.1

* Remove the deprecated `author:` field from pubspec.yaml

## 1.0.0

* Initial release. Contains the interface and an implementation based on
  method channels.







 
