-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
[go_router] Path and query parameters are not preserved in StatefulShellRoute #129878
Comments
Thanks for the report @MicTheFox |
@darshankawar Looks similar, but the bug here occurs without using any redirect. I don't know how |
Thanks for the update. Using the original repo code, seeing the same behavior as reported. Maybe related to #123973 stable, master flutter doctor -v
|
How can this issue not been fixed already after 1 month ? Its like a core thing lol |
This issue is marked P1 but has had no recent status updates. The P1 label indicates high-priority issues that are at the top of the work list. This is the highest priority level a bug can have if it isn't affecting a top-tier customer or breaking the build. Bugs marked P1 are generally actively being worked on unless the assignee is dealing with a P0 bug (or another P1 bug). Issues at this level should be resolved in a matter of months and should have monthly updates on GitHub. Please consider where this bug really falls in our current priorities, and label it or assign it accordingly. This allows people to have a clearer picture of what work is actually planned. Thanks! |
same behavior with |
this is serious bug, but this should wait for the flutter/packages#5497 to land. |
I hope the team can fix it ASAP. I got this issue when I used a 'redirect'. To fix this issue, I just updated the path from 'redirect' and added custom path parameters and works like a charm.
|
Any updates on this issue? |
@Uirado did you update go router? For us it was fixed with the update to newest version |
@bes89 Yes. I tested using version |
Hi, Is there any solution for this
Then when I used the goBranch(index) path parameters returns named like ":id". Same issue issue#137823 I think |
I have the same problem...Thought I might have done something wrong. I am struggling to create a deeply nested typed navigation with TypedStatefulShellRoute, I have a sidebar menu that navigates to a route that has tabs. Documentation is not quite helping me. @TypedStatefulShellRoute<HomeShellRoute>(
branches: [
TypedStatefulShellBranch<HomeBranch>(
routes: <TypedGoRoute<GoRouteData>>[
TypedGoRoute<HomeRoute>(path: '/home'),
],
),
(...),
TypedStatefulShellBranch<AppsBranch>(
routes: <TypedGoRoute<GoRouteData>>[
TypedGoRoute<AppsRoute>(path: '/apps', routes: [
TypedGoRoute<AppRoute>(path: ':id', routes: [
TypedStatefulShellRoute<AppShellRoute>(branches: [
TypedStatefulShellBranch<AppGeneralBranch>(
routes: [TypedGoRoute<AppGeneralRoute>(path: 'general')]),
TypedStatefulShellBranch<AppSupporBranch>(
routes: [TypedGoRoute<AppSupportRoute>(path: 'support')]),
])
]),
]),
],
),
],
) |
Is there any movement on this P1? My BottomDrawer navigation is just broken without it :( is there anything we can do to help? |
I forgot to follow up on this |
The missing path parameters are indeed considered a bug I am not sure whether the query parameter should carry over by default, what happen if gobranch goes to a branch that has existing state? do we replace it or not? |
I think I'd probably expect the query parameters not to be passed across multiple routes but would, perhaps, expect to be able to add them optionally via gobranch? |
Just updated and everything looks good to me! Thanks for jumping on this quickly, it's appreciated :) |
@chunhtai Thank you for your effort and quick reply. Unfortunately, on my environment, the path parameter is not changing anymore, but nested shell index seems not to change either, which makes my nested navigation stop working. I did not change any code, just updated dependency go_router to 14.1.2 and dev_dependency go_router_builder to 2.7.0. I ran Its not quite visible on the image, but navigationShell.currentIndex stays on 0, before the updat my onTap event would change it (0 first tab, 1 second tab). |
can you file a new bug for this with repro? |
Is there an existing issue for this?
Steps to reproduce
The sample code provided is a variation of the StatefulShellRoute example. In this example the StatefulShellRoute is a SubRoute of the route
/list/:id
which contains the path parameter:id
. The:id
parameter is initially set correctly, but is not preserved after callinggoBranch()
. The same behaviour happens toqueryParameters
(not implemented in the provided sample code).Expected results
The "id" parameter should stay the same as before.
Actual results
The "id" parameter actually has the value ":id".
Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-07-01.at.20.12.16.mp4
Logs
No response
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: