Skip to content

Conversation

@chunhtai
Copy link
Contributor

@chunhtai chunhtai commented Dec 7, 2022

fixes flutter/flutter#115832
fixes flutter/flutter#115962

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

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

@chunhtai chunhtai requested a review from johnpryan December 7, 2022 17:44
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));
Copy link
Contributor

Choose a reason for hiding this comment

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

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);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, I am worrying about the performance though. let me see what i can do.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fair - as written this code looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to move forward at the current implementation, we can revisit if this does become a problem.

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 7, 2022
@auto-submit auto-submit bot merged commit 250adea into flutter:main 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.
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 p: go_router

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[go_router] 5.2.0 push doesn't update the URL anymore. [go_router] Navigating back does not update router location since go_router 5.2.0

2 participants