-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[go_router] Add support for relative routes #6825
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
Merged
auto-submit
merged 20 commits into
flutter:main
from
ThangVuNguyenViet:go_router/go-relative
Nov 13, 2024
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
02689ff
- Adds `GoRouter.goRelative`
ThangVuNguyenViet e8ac4ee
add go_relative example for go_router
ThangVuNguyenViet c42151c
add go_relative_test for the example
ThangVuNguyenViet 022db98
fix failed test
ThangVuNguyenViet 812498e
replace goRelative with go('./$path')
ThangVuNguyenViet 07b63ad
Commit missing files during merge
ThangVuNguyenViet c025d86
update changelog & version
ThangVuNguyenViet 3fb6463
Prevent concatenateUris from adding trailing redundant '?'. Add test …
ThangVuNguyenViet 205d096
Add more `concatenateUris` test. Fix joining params
ThangVuNguyenViet 8e4db8e
update example description
ThangVuNguyenViet 0ead0af
Make concatenateUris not merging parameters, only take them from chil…
ThangVuNguyenViet 9407200
Refactor example & its test
ThangVuNguyenViet 6830539
Remove TypedRelativeGoRoute
ThangVuNguyenViet 43eb497
Add missing import
ThangVuNguyenViet 2dd80d9
add fragment test to concatenateUris
ThangVuNguyenViet 3071a53
Merge branch 'main' into go_router/go-relative
ThangVuNguyenViet 4dba574
Merge branch 'main' of github.com:flutter/packages into go_router/go-…
ThangVuNguyenViet fb61d97
Merge branch 'main' into go_router/go-relative
ThangVuNguyenViet d1ebfeb
bump version to 14.4.2 in pubspec.yaml
ThangVuNguyenViet c246bc3
Merge branch 'main' into go_router/go-relative
chunhtai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Commit missing files during merge
- Loading branch information
commit 07b63ad218f26d8faddcd83eebf4718e024476d7
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the path looks good, but I am a bit hesitate on also merge query parameter. It has different logic from regular go. Regular go will not attempt to merge with current query parameters. I think we should probably follow the same logic to avoid confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm this is quite interesting thing thou. Take this example.
We're in
/family/f2?sort=descand we're going to the innerperson/p1route, and we'll pop it to go back to thefamilyroute. How are devs handling this case?In go_router_builder, devs can't use the easy
PersonRoute(pid: 'p1').gobut rather have to get itsroute.location, convert to Uri, and then manually add the sort param. Being able to useRoute().goin builder is kinda a big selling point of the package imoThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can access GoRouterState.of(context).uri.queryParemeters.
Also won't in this case PersonRoute also declare
sortparameter?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sense. I've been doing things wrong in my app then