[go_router] fixes pop and push to update urls correctly#2904
Merged
auto-submit[bot] merged 2 commits intoflutter:mainfrom Dec 7, 2022
Merged
[go_router] fixes pop and push to update urls correctly#2904auto-submit[bot] merged 2 commits intoflutter:mainfrom
auto-submit[bot] merged 2 commits intoflutter:mainfrom
Conversation
johnpryan
reviewed
Dec 7, 2022
| void pop() { | ||
| if (_matches.last.route is GoRoute) { | ||
| final GoRoute route = _matches.last.route as GoRoute; | ||
| _uri = _uri.replace(path: removePatternFromPath(route.path, _uri.path)); |
Contributor
There was a problem hiding this comment.
It might be better to keep a single source of truth - the List<RouteMatch> should be all that we need to compute the current url - otherwise we risk the URI getting out of sync with the list of matches.
We could make uri a getter that produces the URI based on the current match list:
Uri get uri => _computeUri(matches);
Contributor
Author
There was a problem hiding this comment.
I agree, I am worrying about the performance though. let me see what i can do.
Contributor
There was a problem hiding this comment.
That's fair - as written this code looks good.
Contributor
Author
There was a problem hiding this comment.
I decided to move forward at the current implementation, we can revisit if this does become a problem.
johnpryan
approved these changes
Dec 7, 2022
ycherniavskyi
added a commit
to WebTrit/webtrit_phone
that referenced
this pull request
Mar 14, 2023
The particular fix that affects the active call screen is flutter/packages#2904.
2 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixes flutter/flutter#115832
fixes flutter/flutter#115962
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.