Repository navigation
[go_router] Document when GoRouterState.name and path are null - #13486
Alokxyz1112 wants to merge 2 commits into
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If both you and the PR author believe this PR qualifies for a test exemption, escalate to the tech lead for the changed area to review and apply the |
There was a problem hiding this comment.
Code Review
This pull request updates the documentation for GoRouterState.name and GoRouterState.path to clarify the specific scenarios in which these properties are null, and adds a corresponding changelog entry. The feedback suggests a grammatical correction to ensure proper subject-verb agreement in the updated documentation for GoRouterState.path.
| /// the state built for a [ShellRoute] or [StatefulShellRoute] (which have no | ||
| /// path of their own), and the state used for the error page. |
There was a problem hiding this comment.
The phrase 'a [ShellRoute] or [StatefulShellRoute]' is singular disjunctive, so the parenthetical clause should use singular verbs and pronouns ('has' and 'its') for proper subject-verb agreement.
| /// the state built for a [ShellRoute] or [StatefulShellRoute] (which have no | |
| /// path of their own), and the state used for the error page. | |
| /// the state built for a [ShellRoute] or [StatefulShellRoute] (which has no | |
| /// path of its own), and the state used for the error page. |
GoRouterState.nameandGoRouterState.pathare nullable, and the docs only said they can be null for the top level redirect, which left people guessing (see the issue). Going through every place that builds aGoRouterState, they are left null in:RouteConfiguration.buildTopLevelGoRouterState, used for the top levelGoRouter.redirectandonExceptionShellRouteMatch.buildState, since aShellRoute/StatefulShellRoutehas no path of its ownRouteBuilder._buildErrorState, used for the error pagenameis also null when theGoRoutejust has no name. This updates both doc comments to list those cases. Added a pending changelog entry (patch).Fixes flutter/flutter#121086
Pre-Review Checklist
[shared_preferences]///).Tests: exempt, this only changes doc comments.
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