Skip to content

[go_router] Document when GoRouterState.name and path are null - #13486

Merged
auto-submit[bot] merged 2 commits into
flutter:mainfrom
Alokxyz1112:go-router-nullable-path-docs
Nov 19, 2026
Merged

auto-submit[bot] merged 2 commits into
flutter:mainfrom
Alokxyz1112:go-router-nullable-path-docs

Conversation

@Alokxyz1112

@Alokxyz1112 Alokxyz1112 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

GoRouterState.name and GoRouterState.path are 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 a GoRouterState, they are left null in:

  • RouteConfiguration.buildTopLevelGoRouterState, used for the top level GoRouter.redirect and onException
  • ShellRouteMatch.buildState, since a ShellRoute / StatefulShellRoute has no path of its own
  • RouteBuilder._buildErrorState, used for the error page

name is also null when the GoRoute just 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

Tests: exempt, this only changes doc comments.

Footnotes

  1. 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

@flutter-dashboard

Copy link
Copy Markdown

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 test-exempt label. All reviewers should feel empowered to ask for tests before escalating.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/go_router/lib/src/state.dart Outdated
Comment on lines +61 to +62
/// the state built for a [ShellRoute] or [StatefulShellRoute] (which have no
/// path of their own), and the state used for the error page.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
/// 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.

@tarrinneal
tarrinneal requested a review from Piinks November 3, 2026 21:46

@Piinks Piinks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Alokxyz1112 welcome. Thanks for contributing. This doc change is test exempt and LGTM

@Piinks Piinks added the CICD Run CI/CD label Nov 19, 2026

@dkwingsmt dkwingsmt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Piinks
Piinks force-pushed the go-router-nullable-path-docs branch from 9a5ba5d to 6f440dc Compare November 19, 2026 18:25
@github-actions github-actions Bot added the P3 Issues that are less important to the Flutter project label Nov 19, 2026
@Piinks Piinks added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App and removed P3 Issues that are less important to the Flutter project labels Nov 19, 2026
@github-actions github-actions Bot added the P3 Issues that are less important to the Flutter project label Nov 19, 2026
@auto-submit
auto-submit Bot merged commit ca0a2d3 into flutter:main Nov 19, 2026
14 checks passed
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-flutter__flutter that referenced this pull request Nov 20, 2026
…er#197056)

flutter/packages@81b7c44...898818d

2026-11-20 [email protected] [material_ui] Use correct time format for
Sinhala locale (flutter/packages#13645)
2026-11-20 [email protected] [material_ui]
Fix showModalBottomSheet safe area on display-feature sub-screens
(flutter/packages#13428)
2026-11-20 [email protected] [material_ui]
Fix M3 doc errors in the `ElevatedButton` and `FilledButton`
(flutter/packages#13685)
2026-11-19 [email protected] [video_player] Convert implementation
to Kotlin (flutter/packages#13683)
2026-11-19 [email protected] [flutter_svg] Add
SvgLoader.provideSvgInIsolate for unsendable loaders
(flutter/packages#13598)
2026-11-19 [email protected] [VPAT] Expose modal drawers with the
dialog semantics role (flutter/packages#13660)
2026-11-19 [email protected] [VPAT] Keep a11y_assessments tooltips
open while hovered (flutter/packages#13657)
2026-11-19 [email protected] [flutter_svg] Stabilize network SVG cache
keys (flutter/packages#13597)
2026-11-19 [email protected]
[image_picker_ios] Return an error instead of an empty file when an
image cannot be saved (flutter/packages#12998)
2026-11-19 [email protected] [cupertino_ui]
Fix CupertinoNavigationBarBackButton assertion debug
(flutter/packages#13397)
2026-11-19 [email protected] [go_router] Document when
GoRouterState.name and path are null (flutter/packages#13486)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: go_router P3 Issues that are less important to the Flutter project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document why GoRouterState.path and GoRouterState.fullpath can be non

3 participants