Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[shared_preferences] Shared preferences shared preferences #7994

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

tarrinneal
Copy link
Contributor

Shared Preferences

@@ -52,7 +52,7 @@ latest data stored on the native platform regardless of what process was used to

The [SharedPreferences] API uses the native [Android Shared Preferences](https://developer.android.com/reference/android/content/SharedPreferences) tool to store data.

The [SharedPreferencesAsync] and [SharedPreferencesWithCache] APIs use [DataStore Preferences](https://developer.android.com/topic/libraries/architecture/datastore) to store data.
The [SharedPreferencesAsync] and [SharedPreferencesWithCache] APIs can use [DataStore Preferences](https://developer.android.com/topic/libraries/architecture/datastore) or [Android Shared Preferences](https://developer.android.com/reference/android/content/SharedPreferences) to store data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 190 will also need an update.

if (!options.useDataStore) {
createSharedPreferences(options).edit().putBoolean(key, value).apply()
return
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be easier to have a second HostApi for the SharedPreferences codepath, and have the Dart code call one or the other depending on the options?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants