-
-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
maybePop on web forgets query parameters in the url bar. #2085
Comments
Ok, it looks like a bug in the if (result.continueNavigation) {
_updateSharedPathData(
queryParams: route.rawQueryParams, //<<< HERE the new route's query parameters go into query parameters of previous route data.
fragment: route.fragment,
includeAncestors: true,
);
return _addEntry<T>(match, notify: notify);
} but it just erases the root page's query parameters and put there query parameters of the next page. I can't find any settings to prevent such a behavior. |
@Milad-Akarie could you please help me to understand the purpose of this method? // should find a way to avoid this
void _updateSharedPathData({
Map<String, dynamic> queryParams = const {},
String fragment = '',
bool includeAncestors = false,
}); It has been written many years ago in a big commit, so I can't figure out what was there. |
Still not sure about the implementation until today, shared path data are query params and the fragment. |
Ok, I see.. I'm actually not sure the lower routes should access route data from upper routes, but if it's really needed, we can write some class that could store autorelease data from upper routes when they are pushed in the stack, for example. |
I think that this sharing logic should be removed from the routing library, since that's the responsibility of the app logic. If you get a deeplink, say |
Hello.
When I use
@QueryParam
on the root page, then push a new page and callcontext.maybePop
, the url of the root page loses query parameters, although the state of the root page stays correct (parameters of the root page widget annotated with@QueryParam
store correct data).I push a new route like this:
What am I doing wrong?
The text was updated successfully, but these errors were encountered: