Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Apr 24, 2020

When initial route is an empty string, it breaks routing in Flutter because it doesn't match the default "/". This PR fixes the issue by never returning an empty string as a path. Instead it returns "/" when the path is an empty string.

Fixes flutter/flutter#55426

@mdebbar mdebbar added the platform-web Code specifically for the web engine label Apr 24, 2020
@mdebbar mdebbar requested review from nturgut and yjbanov April 24, 2020 19:39
@mdebbar mdebbar self-assigned this Apr 24, 2020
return '/';
}
// At this point, we know [path] starts with "#" and isn't empty.
return path.substring(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated to this PR: I wonder if we can tests these things in integration tests now :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. I think this can be done as part of the single integration test that goes through the gallery app and clicks around.

Copy link
Contributor

@nturgut nturgut left a comment

Choose a reason for hiding this comment

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

Thanks @mdebbar !

@mdebbar mdebbar force-pushed the empty_initial_route_name branch from 26ac69a to eb35e42 Compare April 27, 2020 12:54
@mdebbar mdebbar added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Apr 27, 2020
@fluttergithubbot fluttergithubbot merged commit aa00d50 into flutter:master Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes platform-web Code specifically for the web engine waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flutter Web don't work to NamedRoutes on 1.18.0

4 participants