[shared_preferences] allow custom key prefixes#3465
[shared_preferences] allow custom key prefixes#3465auto-submit[bot] merged 9 commits intoflutter:mainfrom
Conversation
There was a problem hiding this comment.
I considered having a defaultPrefix and a nullable prefix and checking to see if prefix were null instead. This seemed "more readable" so I went with this.
There was a problem hiding this comment.
This could be changed to an assert, or a state error if not set up correctly, similar to the main package setPrefix method
ditman
left a comment
There was a problem hiding this comment.
Web bits LGTM. Thanks for adding this feature!
(Small question about the need for the static setPrefix method)
packages/shared_preferences/shared_preferences/lib/shared_preferences.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/lib/shared_preferences.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/lib/shared_preferences.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/lib/shared_preferences.dart
Outdated
Show resolved
Hide resolved
...ndroid/android/src/main/java/io/flutter/plugins/sharedpreferences/MethodCallHandlerImpl.java
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/test/shared_preferences_test.dart
Outdated
Show resolved
Hide resolved
...ndroid/android/src/main/java/io/flutter/plugins/sharedpreferences/MethodCallHandlerImpl.java
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences_foundation/pigeons/messages.dart
Outdated
Show resolved
Hide resolved
...preferences/shared_preferences_platform_interface/lib/method_channel_shared_preferences.dart
Outdated
Show resolved
Hide resolved
...erences/shared_preferences_platform_interface/lib/shared_preferences_platform_interface.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences_linux/lib/shared_preferences_linux.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
This feels particularly fragile at the moment, in the way it interacts with remove and setValue. I can rework the way the cached preferences are gotten to avoid this interaction if people agree that it's problematic here.
stuartmorgan-g
left a comment
There was a problem hiding this comment.
Looks good with a few last comments.
There are no comments at the platform interface level now though, so go ahead and split that out and we can get it approved and landed!
packages/shared_preferences/shared_preferences/lib/shared_preferences.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/lib/shared_preferences.dart
Outdated
Show resolved
Hide resolved
.../shared_preferences/shared_preferences/example/integration_test/shared_preferences_test.dart
Outdated
Show resolved
Hide resolved
It's already up and ready, #3497 |
08950c7 to
076d387
Compare
packages/shared_preferences/shared_preferences/test/shared_preferences_test.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/test/shared_preferences_test.dart
Outdated
Show resolved
Hide resolved
|
@stuartmorgan this is ready for final review |
[shared_preferences] allow custom key prefixes
Allows the use of custom prefixes for all platform (not relevant for windows and linux).
If no custom prefix is supplied, the default prefix
flutter.will be used instead.Fixes flutter/flutter#52544
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.