Skip to content

[go_router] Document regex constraints for path parameters - #12281

Merged
auto-submit[bot] merged 1 commit into
flutter:mainfrom
saurabh-mirajkar:docs-go_router-regex
Aug 5, 2026
Merged

[go_router] Document regex constraints for path parameters#12281
auto-submit[bot] merged 1 commit into
flutter:mainfrom
saurabh-mirajkar:docs-go_router-regex

Conversation

@saurabh-mirajkar

Copy link
Copy Markdown
Contributor

Description

Documents the regular expression constraint syntax supported by GoRoute.path.

GoRoute already supports path parameters in the form :paramName(regex), but this syntax is not currently documented. This change documents the syntax, provides a valid Dart example, and explains how constrained path parameters participate in route matching.

Fixes flutter/flutter#177766

Testing

  • No new tests were added because this is a documentation-only change.
  • Ran dart run script/tool/bin/flutter_plugin_tools.dart test --packages=go_router.

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

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 flutter-dashboard Bot added the CICD Run CI/CD label Jul 24, 2026
@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 you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions Bot added p: go_router triage-framework Should be looked at in framework triage labels Jul 24, 2026

@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 documents the support for regular expression constraints in GoRoute path parameters within route.dart and adds a corresponding pending changelog entry. There are no review comments, and no additional feedback is provided.

Comment thread packages/go_router/lib/src/route.dart Outdated
@saurabh-mirajkar
saurabh-mirajkar force-pushed the docs-go_router-regex branch 2 times, most recently from 1ba0132 to 817ccdc Compare July 29, 2026 05:34
Comment thread packages/go_router/example/lib/path_parameter_regex.dart

@chunhtai chunhtai 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

@chunhtai
chunhtai requested a review from hannah-hyj July 30, 2026 03:21
Comment thread packages/go_router/example/lib/path_parameter_regex.dart
Comment thread packages/go_router/example/test/path_parameter_regex_test.dart

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

LGTM

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 5, 2026
@auto-submit
auto-submit Bot merged commit b1424e2 into flutter:main Aug 5, 2026
13 checks passed
pull Bot pushed a commit to AbhiShake1/flutter that referenced this pull request Aug 5, 2026
…r#190622)

flutter/packages@3498b9d...b1424e2

2026-08-05 saurabhmirajkar000@gmail.com [go_router] Document regex
constraints for path parameters (flutter/packages#12281)
2026-08-04 fluttergithubbot@gmail.com Sync release-cupertino_ui-0.0.3 to
main (flutter/packages#12367)
2026-08-04 43054281+camsim99@users.noreply.github.com
[camera_android_camerax] Fix video recording after backgrounding app
(flutter/packages#12145)
2026-08-04 jmccandless@google.com [material_ui and cupertino_ui] Remove
workspaces and fix CI (flutter/packages#12351)
2026-08-04 fluttergithubbot@gmail.com Sync release-material_ui-0.0.3 to
main (flutter/packages#12352)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com 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 triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[go_router] Improve docs about regex support

3 participants