-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
This code ignores the pathname and query parameters (search), if there is an internalUrl.
Before initial routing:
http://localhost:45389/?example=true
After routing:
http://localhost:45389/#/menu
After routing (with fix):
http://localhost:45389/?example=true#/menu
flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart
Lines 103 to 105 in ce94230
| return internalUrl.isEmpty | |
| ? '${_platformLocation.pathname}${_platformLocation.search}' | |
| : '#$internalUrl'; |
In our use case, it would be important to keep these parameters in the URL, even when routing in Flutter.
And as with other technologies (e.g. React Router), the parameters remain unchanged, and the hash routing is appended.
Example fix:
return "${_platformLocation.pathname}${_platformLocation.search}${internalUrl.isEmpty ? '' : '#$internalUrl'}";Workaround:
Extend HashUrlStrategy with the fix and set it via setUrlStrategy from flutter_web_plugins.