Skip to content
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] Add support for preloading branches of StatefulShellRoute (revised solution) #6467

Merged
merged 20 commits into from
Nov 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Code style cleanup.
  • Loading branch information
tolo committed Sep 24, 2024
commit 9d68693eaeb4b2197b6f68ba9d5feb67d6f2005c
9 changes: 5 additions & 4 deletions packages/go_router/lib/src/route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1384,8 +1384,9 @@ class StatefulNavigationShellState extends State<StatefulNavigationShell>
@override
void dispose() {
super.dispose();
_branchState.forEach(
(_, _StatefulShellBranchState branchState) => branchState.dispose());
for (final _StatefulShellBranchState branchState in _branchState.values) {
branchState.dispose();
}
}

@override
Expand All @@ -1405,8 +1406,8 @@ class StatefulNavigationShellState extends State<StatefulNavigationShell>
.map((StatefulShellBranch branch) => _BranchNavigatorProxy(
key: ObjectKey(branch),
branch: branch,
navigatorForBranch: (StatefulShellBranch b) =>
_branchState[b]?.navigator))
navigatorForBranch: (StatefulShellBranch branch) =>
_branchState[branch]?.navigator))
.toList();

return widget.containerBuilder(context, widget, children);
Expand Down