-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[go_router] implemented helpers for StatefulShellRoute #4228
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
990c293
implemented helpers for StatefulShellRoute
hannah-hyj 4918014
Merge branch 'main' into statefulshellroute
hannah-hyj c6bde6d
lint
hannah-hyj 52ce037
Update route_data.dart
hannah-hyj b9c8080
lint
hannah-hyj 9005a8c
Update route_data.dart
hannah-hyj 8cf69b6
update
hannah-hyj 5963020
resolve comments
hannah-hyj 0ccc645
Update route_data.dart
hannah-hyj b186f35
Merge branch 'main' into statefulshellroute
hannah-hyj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update route_data.dart
- Loading branch information
commit 0ccc64517f034ccf41af25053660e79aa5acc6a7
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,6 +154,8 @@ abstract class ShellRouteData extends RouteData { | |
| required T Function(GoRouterState) factory, | ||
| GlobalKey<NavigatorState>? navigatorKey, | ||
| List<RouteBase> routes = const <RouteBase>[], | ||
| List<NavigatorObserver>? observers, | ||
| String? restorationScopeId, | ||
| }) { | ||
| T factoryImpl(GoRouterState state) { | ||
| return (_stateObjectExpando[state] ??= factory(state)) as T; | ||
|
|
@@ -186,6 +188,8 @@ abstract class ShellRouteData extends RouteData { | |
| pageBuilder: pageBuilder, | ||
| routes: routes, | ||
| navigatorKey: navigatorKey, | ||
| observers: observers, | ||
| restorationScopeId: restorationScopeId, | ||
| ); | ||
| } | ||
|
|
||
|
|
@@ -262,6 +266,7 @@ abstract class StatefulShellRouteData extends RouteData { | |
| builder: builder, | ||
| pageBuilder: pageBuilder, | ||
| navigatorContainerBuilder: navigatorContainerBuilder, | ||
| restorationScopeId: restorationScopeId, | ||
| ); | ||
| } | ||
| return StatefulShellRoute.indexedStack( | ||
|
|
@@ -292,10 +297,16 @@ abstract class StatefulShellBranchData { | |
| static StatefulShellBranch $branch<T extends StatefulShellBranchData>({ | ||
| GlobalKey<NavigatorState>? navigatorKey, | ||
| List<RouteBase> routes = const <RouteBase>[], | ||
| List<NavigatorObserver>? observers, | ||
| String? initialLocation, | ||
| String? restorationScopeId, | ||
| }) { | ||
| return StatefulShellBranch( | ||
| routes: routes, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how does one specify initialLocation and restorationScopeId? we may also want a way to specify observers
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| navigatorKey: navigatorKey, | ||
| observers: observers, | ||
| initialLocation: initialLocation, | ||
| restorationScopeId: restorationScopeId, | ||
| ); | ||
| } | ||
| } | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.