Repository navigation
Commit c4ee37c
authored
[go_router] Preserve nested pushes during config updates (flutter#12611)
`RouteConfiguration.reparse` currently restores only imperative matches at the root of the match list. Imperative matches created by pushing a route owned by a `StatefulShellRoute` branch are nested inside `ShellRouteMatch.matches`, so a dynamic `RoutingConfig` update silently drops them.
This change recursively enumerates imperative matches within shell matches and replays them against the new routing configuration. Rebuilding each match preserves the pushed navigation stack without retaining stale route objects from the previous configuration.
The regression test covers this sequence using the go_router test suite's standard A/B route naming:
1. Start at `/a`.
2. Push `/b/details` into another shell branch.
3. Push `/top` above the shell.
4. Update the routing configuration.
5. Pop `/top` and verify that `Screen B Detail` is restored.
Fixes flutter#167344.
## Pre-Review Checklist
This is a draft pending the author's review of the contribution, AI-assistance, Tree Hygiene, and CLA requirements above.
### Local verification
- `flutter_plugin_tools format --packages go_router`
- `flutter_plugin_tools analyze --packages go_router`
- `flutter_plugin_tools test --packages go_router`
- `flutter_plugin_tools validate --check-for-missing-changes --packages go_router`
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.1 parent 2abaedd commit c4ee37c
3 files changed
Lines changed: 74 additions & 10 deletions
File tree
- packages/go_router
- lib/src
- pending_changelogs
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
352 | 355 | | |
353 | 356 | | |
354 | 357 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
139 | 198 | | |
140 | 199 | | |
141 | 200 | | |
| |||
0 commit comments