[shared_preferences] Document return values of set and remove methods - #12303
[shared_preferences] Document return values of set and remove methods#12303binSaed wants to merge 3 commits into
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
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