-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[go_router_builder][go_router] Add support for relative routes #6823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…s to pass to `Navigator`
… builder without tests
…gh layers to pass to `Navigator`" This reverts commit 1884e2c.
…ly be goRelative-able
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Couple of notes here: I can't either add add tests or example for |
you need to separate out to two pr, one for go_router another one for go_router_builder. Merge go_router pr first and then you can bump the go_router version in this package so that you can write test and example for it |
gotcha. Imma temporarily close this PR and open a new go_router only PR and reopen this once the new PR is merged |
Add supports for relative routes by allowing going to a path relatively, like go('./$path') This PR doesn't fully resolve any issue, but it's mandatory to further add examples & tests for `TypedRelativeGoRoute` (see [#7174](#6823)), which will resolves [#108177](flutter/flutter#108177)
Add supports for [go_router_builder] relative routes by adding
GoRouter.goRelative
which enablesTypedRelativeGoRoute
to be used as relative route.Previously it was impossible to construct relative route trees with
TypedGoRouter
, because the generator will generate duplicate extension class. The only options were either don't use go_router_builder, or (worse) declare each sub-route classes, e.gNow with
TypedRelativeGoRoute
added, we can declare a common sub-routeAnd simply use
DetailsRoute(detailId: 'dId').goRelative(context)
Fixes #108177
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.