Skip to content

Commit db007f4

Browse files
committed
Update based on feedback
1 parent 31d0358 commit db007f4

File tree

7 files changed

+18
-17
lines changed

7 files changed

+18
-17
lines changed

packages/go_router_builder/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 3.0.2
1+
## 3.1.0
22

33
- Adds support for `TypedRelativeGoRoute`.
44
- Restricts `build` to versions less than 2.5.0.

packages/go_router_builder/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,8 @@ An example is available [here](https://github.com/flutter/packages/blob/main/pac
455455

456456
## Relative routes
457457

458-
Define a relative route by extending RelativeGoRouteData.
458+
Relative routes allow reusing the same `RouteData` in different parts of the route tree.
459+
Define a relative route by extending `RelativeGoRouteData`.
459460

460461
<?code-excerpt "example/lib/readme_excerpts.dart (relativeRoute)"?>
461462
```dart

packages/go_router_builder/example/lib/go_relative.g.dart

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/go_router_builder/example/lib/readme_excerpts.g.dart

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/go_router_builder/lib/src/route_config.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ class GoRouteConfig extends RouteBaseConfig with _GoRouteMixin {
456456
}
457457

458458
return '''
459-
mixin $_mixinName on GoRouteData {
459+
mixin $_mixinName on $routeDataClassName {
460460
static $_className _fromState(GoRouterState state) $_fromStateConstructor
461461
$_castedSelf
462462
@override
@@ -531,14 +531,14 @@ class RelativeGoRouteConfig extends RouteBaseConfig with _GoRouteMixin {
531531
}
532532

533533
return '''
534-
mixin $_mixinName on RelativeGoRouteData {
534+
mixin $_mixinName on $routeDataClassName {
535535
static $_className _fromState(GoRouterState state) $_fromStateConstructor
536536
$_castedSelf
537537
@override
538-
String get location => RelativeGoRouteData.\$location($_locationArgs,$_locationQueryParams);
538+
String get subpath => RelativeGoRouteData.\$location($_locationArgs,$_locationQueryParams);
539539
540540
@override
541-
String get relativeLocation => './\$location';
541+
String get relativeLocation => './\$subpath';
542542
543543
@override
544544
void goRelative(BuildContext context) =>

packages/go_router_builder/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: go_router_builder
22
description: >-
33
A builder that supports generated strongly-typed route helpers for
44
package:go_router
5-
version: 3.0.2
5+
version: 3.1.0
66
repository: https://github.com/flutter/packages/tree/main/packages/go_router_builder
77
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router_builder%22
88

packages/go_router_builder/test_inputs/go_relative.dart.expect

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ mixin _$RelativeRoute on RelativeGoRouteData {
4141
static RelativeRoute _fromState(GoRouterState state) => const RelativeRoute();
4242

4343
@override
44-
String get location => RelativeGoRouteData.$location(
44+
String get subpath => RelativeGoRouteData.$location(
4545
'relative-route',
4646
);
4747

4848
@override
49-
String get relativeLocation => './$location';
49+
String get relativeLocation => './$subpath';
5050

5151
@override
5252
void goRelative(BuildContext context) => context.go(relativeLocation);
@@ -69,12 +69,12 @@ mixin _$InnerRelativeRoute on RelativeGoRouteData {
6969
const InnerRelativeRoute();
7070

7171
@override
72-
String get location => RelativeGoRouteData.$location(
72+
String get subpath => RelativeGoRouteData.$location(
7373
'inner-relative-route',
7474
);
7575

7676
@override
77-
String get relativeLocation => './$location';
77+
String get relativeLocation => './$subpath';
7878

7979
@override
8080
void goRelative(BuildContext context) => context.go(relativeLocation);

0 commit comments

Comments
 (0)