Skip to content

[web] Always send the route name even if it's null - #41996

Merged
mdebbar merged 3 commits into
flutter:masterfrom
mdebbar:web_clear_route
Oct 7, 2019
Merged

[web] Always send the route name even if it's null#41996
mdebbar merged 3 commits into
flutter:masterfrom
mdebbar:web_clear_route

Conversation

@mdebbar

@mdebbar mdebbar commented Oct 4, 2019

Copy link
Copy Markdown
Contributor

Description

When a nameless route is pushed, we should be sending a platform message with route name as null in order for the engine to be able clear the browser url.

Related Issues

Fixes #41375

Tests

I added tests in following files:

  • test/widgets/route_notification_messages_test.dart

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@fluttergithubbot fluttergithubbot added the framework flutter/packages/flutter repository. See also f: labels. label Oct 4, 2019
@goderbauer

Copy link
Copy Markdown
Member

Is clearing really the right choice? If I am on page x and I press a button to bring up some kind of a pop-up route (which I believe is implemented as nameless route) it still feels like I am on page x.

@goderbauer

Copy link
Copy Markdown
Member

(Unrelated to this PR:) It also looks like the way these notifications work don't work with nested navigators.

@mdebbar

mdebbar commented Oct 4, 2019

Copy link
Copy Markdown
Contributor Author

If I am on page x and I press a button to bring up some kind of a pop-up route (which I believe is implemented as nameless route) it still feels like I am on page x.

@goderbauer that's a good point. But the problem is how can we distinguish between pop-up routes and real routes that happen to have no name?

It also looks like the way these notifications work don't work with nested navigators.

If that's the case, I'd love to fix it :) Could you elaborate please?

@mdebbar
mdebbar requested a review from nturgut October 4, 2019 19:02
@mdebbar mdebbar self-assigned this Oct 4, 2019
@mdebbar mdebbar added this to the October 2019 milestone Oct 4, 2019
@mdebbar mdebbar added f: routes Navigator, Router, and related APIs. platform-web Web applications specifically labels Oct 4, 2019
@goderbauer

Copy link
Copy Markdown
Member

If you have a root navigator and a nested navigator B. If you navigate to a different page within B, the URL bar will only show the route within B. It doesn't show the route within the root navigator anymore to get to the page that contained the nested navigator.

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

Thanks!

@mdebbar mdebbar changed the title [web] Clear route name when a nameless route is pushed [web] Always send the route name even if it's null Oct 4, 2019
@mdebbar
mdebbar merged commit 1946fc4 into flutter:master Oct 7, 2019
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Nov 26, 2019
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels. platform-web Web applications specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Web] Navigation and window href

5 participants