shared_preferences_android 2.4.8 copy "shared_preferences_android: ^2.4.8" to clipboard
shared_preferences_android: ^2.4.8 copied to clipboard

PlatformAndroid

Android implementation of the shared_preferences plugin

shared_preferences_android #

The Android implementation of shared_preferences.

Usage #

This package is endorsed, which means you can simply use shared_preferences normally. This package will be automatically included in your app when you do, so you do not need to add it to your pubspec.yaml.

However, if you import this package to use any of its APIs directly, you should add it to your pubspec.yaml as usual.

Options #

The [SharedPreferencesAsync] and [SharedPreferencesWithCache] APIs can use DataStore Preferences or Android SharedPreferences to store data.

To use the Android SharedPreferences backend, use the SharedPreferencesAsyncAndroidOptions when using [SharedPreferencesAsync].

const SharedPreferencesAsyncAndroidOptions options =
    SharedPreferencesAsyncAndroidOptions(
        backend: SharedPreferencesAndroidBackendLibrary.SharedPreferences,
        originalSharedPreferencesOptions: AndroidSharedPreferencesStoreOptions(
            fileName: 'the_name_of_a_file'));
copied to clipboard

The [SharedPreferences] API uses the native Android SharedPreferences tool to store data.

13
likes
150
points
3.54M
downloads

Publisher

verified publisherflutter.dev

Weekly Downloads

2024.09.08 - 2025.03.23

Android implementation of the shared_preferences plugin

Repository (GitHub)
View/report issues
Contributing

Topics

#persistence #shared-preferences #storage

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, shared_preferences_platform_interface

More

Packages that depend on shared_preferences_android