Repository navigation
[shared_preferences] Document return values of set and remove methods - #12303
Conversation
Add dartdoc to setBool, setInt, setDouble, setString, setStringList, and remove explaining the meaning of their return values, using the wording suggested by @stuartmorgan-g in the closed PR flutter#7198. Fixes flutter/flutter#146070
There was a problem hiding this comment.
Code Review
This pull request updates the documentation comments for the setBool, setInt, setDouble, setString, setStringList, and remove methods in SharedPreferences to clarify their return value behavior. Specifically, it explains that these methods return false if the platform implementation definitively determines that the operation failed, and true otherwise. There are no review comments, so there is no additional feedback to provide.
|
Thank you for your contribution! Because of the volume of PRs we receive, we require that new contributors use our checklist to guide them through critical steps in creating a Flutter PR. This PR's description is missing that checklist, so it is being marked as a Draft. Please edit the PR description to add the checklist, then ensure that you have completed all of the steps. Once you've done that, please mark the PR as ready for review. If you need help, consider asking for advice on the #hackers-new channel on Discord. |
|
(In the future, please don't ping people in PR descriptions. This causes pings both when the PR is opened, and also when the PR description becomes the commit message, and then many more times when people update their forks of the repository to include that commit. I've removed username references from the description.) |
16021cc to
47df70c
Compare
47df70c to
3223ba7
Compare
| @@ -1,6 +1,7 @@ | |||
| ## NEXT | |||
There was a problem hiding this comment.
The version will need to be updated to actually publish these comments. change this to 2.5.6, and update the pubspec version as well. Then it can land
There was a problem hiding this comment.
Done, bumped to 2.5.6 in both CHANGELOG.md and pubspec.yaml.
bc7c15f to
3c5f87d
Compare
…r#193919) flutter/packages@951f2f7...7660d46 2026-10-06 [email protected] [image_picker] Document that retrieving lost data is a one-time operation (flutter/packages#12784) 2026-10-05 [email protected] [shared_preferences] Document return values of set and remove methods (flutter/packages#12303) 2026-10-05 [email protected] Redistribute package ownership among Android team (flutter/packages#13138) 2026-10-05 [email protected] Remove redundant null argument values across packages (flutter/packages#13115) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
The
setBool,setInt,setDouble,setString,setStringList, andremovemethods onSharedPreferencesall returnFuture<bool>, but the documentation never explains what the return value means. As noted in a prior PR review, the return value is not self-documenting and required reading every platform implementation to understand.This PR adds dartdoc to each of these methods using the wording suggested in that review:
Fixes flutter/flutter#146070
Pre-Review Checklist
[shared_preferences]///).Version/CHANGELOG note: documentation-only change; added a CHANGELOG entry under the existing
## NEXTsection with no version bump.Test exemption: documentation-only change (dartdoc comments only, no code changes).
Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2