-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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] Adds Shared preferences as option in shared preferences async android #7994
base: main
Are you sure you want to change the base?
[shared_preferences] Adds Shared preferences as option in shared preferences async android #7994
Conversation
...roid/android/src/main/kotlin/io/flutter/plugins/sharedpreferences/SharedPreferencesPlugin.kt
Outdated
Show resolved
Hide resolved
978df17
to
99f76da
Compare
...roid/android/src/main/kotlin/io/flutter/plugins/sharedpreferences/SharedPreferencesPlugin.kt
Outdated
Show resolved
Hide resolved
.../shared_preferences/shared_preferences_android/lib/src/shared_preferences_async_android.dart
Outdated
Show resolved
Hide resolved
.../shared_preferences/shared_preferences_android/lib/src/shared_preferences_async_android.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences_android/README.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to the integration test suggestion, we should have a unit test that writes directly to the default SP store, and then reads it back via backend
.
return SharedPreferencesPigeonOptions(); | ||
} | ||
|
||
SharedPreferencesAsyncApi _getApiForBackend( | ||
SharedPreferencesPigeonOptions options) { | ||
return options.useDataStore ? _dataStoreApi : _sharedPreferencesApi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of the same API with different suffixes so you could switch in a single place is very clever!
.../shared_preferences/shared_preferences_android/lib/src/shared_preferences_async_android.dart
Outdated
Show resolved
Hide resolved
.../shared_preferences/shared_preferences_android/lib/src/shared_preferences_async_android.dart
Outdated
Show resolved
Hide resolved
de43522
to
95eb61e
Compare
Adds the ability to select which Android preferences backend (SharedPreferences or DataStore Preferences) one would like to use.
Also adds the ability to pick a file name for the shared preferences backend.
fixes flutter/flutter#153300
fixes flutter/flutter#14337