Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
3 changes: 3 additions & 0 deletions packages/go_router_builder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.3.2
* Add initialLocation with StatefulShellBranchConfig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Adds


## 2.3.1

* Adds pub topics to package metadata.
Expand Down
11 changes: 10 additions & 1 deletion packages/go_router_builder/lib/src/route_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ class StatefulShellBranchConfig extends RouteBaseConfig {
required super.routeDataClass,
required super.parent,
this.restorationScopeId,
this.initialLocation,
}) : super._();

/// The command for calling the navigator key getter from the ShellRouteData.
Expand All @@ -145,6 +146,9 @@ class StatefulShellBranchConfig extends RouteBaseConfig {
/// The restoration scope id.
final String? restorationScopeId;

/// The initial route.
final String? initialLocation;

@override
Iterable<String> classDeclarations() => <String>[];

Expand All @@ -153,7 +157,8 @@ class StatefulShellBranchConfig extends RouteBaseConfig {
@override
String get routeConstructorParameters =>
'${navigatorKey == null ? '' : 'navigatorKey: $navigatorKey,'}'
'${restorationScopeId == null ? '' : 'restorationScopeId: $restorationScopeId,'}';
'${restorationScopeId == null ? '' : 'restorationScopeId: $restorationScopeId,'}'
'${initialLocation == null ? '' : 'initialLocation: $initialLocation,'}';

@override
String get routeDataClassName => 'StatefulShellBranchData';
Expand Down Expand Up @@ -502,6 +507,10 @@ abstract class RouteBaseConfig {
classElement,
parameterName: r'$restorationScopeId',
),
initialLocation: _generateParameterGetterCode(
classElement,
parameterName: r'$initialLocation',
),
);
break;
case 'TypedGoRoute':
Expand Down
2 changes: 1 addition & 1 deletion packages/go_router_builder/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: go_router_builder
description: >-
A builder that supports generated strongly-typed route helpers for
package:go_router
version: 2.3.1
version: 2.3.2
repository: https://github.com/flutter/packages/tree/main/packages/go_router_builder
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router_builder%22

Expand Down