Skip to content
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
update README
  • Loading branch information
StevenSorial committed Jun 1, 2025
commit 47fa48eff13eb4d5b73672938e17827128f1e8b1
15 changes: 8 additions & 7 deletions packages/go_router_builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ method.

<?code-excerpt "example/lib/readme_excerpts.dart (HomeRoute)"?>
```dart
class HomeRoute extends GoRouteData {
class HomeRoute extends GoRouteData with _$HomeRoute {
const HomeRoute();

@override
Expand All @@ -108,7 +108,7 @@ The tree of routes is defined as an attribute on each of the top-level routes:
),
],
)
class HomeRoute extends GoRouteData {
class HomeRoute extends GoRouteData with _$HomeRoute {
const HomeRoute();

@override
Expand All @@ -124,7 +124,7 @@ class RedirectRoute extends GoRouteData {
}

@TypedGoRoute<LoginRoute>(path: '/login')
class LoginRoute extends GoRouteData {
class LoginRoute extends GoRouteData with _$LoginRoute {
LoginRoute({this.from});
final String? from;

Expand Down Expand Up @@ -211,7 +211,7 @@ Parameters (named or positional) not listed in the path of `TypedGoRoute` indica
<?code-excerpt "example/lib/readme_excerpts.dart (login)"?>
```dart
@TypedGoRoute<LoginRoute>(path: '/login')
class LoginRoute extends GoRouteData {
class LoginRoute extends GoRouteData with _$LoginRoute {
LoginRoute({this.from});
final String? from;

Expand All @@ -229,7 +229,7 @@ For query parameters with a **non-nullable** type, you can define a default valu
<?code-excerpt "example/lib/readme_excerpts.dart (MyRoute)"?>
```dart
@TypedGoRoute<MyRoute>(path: '/my-route')
class MyRoute extends GoRouteData {
class MyRoute extends GoRouteData with _$MyRoute {
MyRoute({this.queryParameter = 'defaultValue'});
final String queryParameter;

Expand All @@ -250,7 +250,7 @@ parameter with the special name `$extra`:

<?code-excerpt "example/lib/readme_excerpts.dart (PersonRouteWithExtra)"?>
```dart
class PersonRouteWithExtra extends GoRouteData {
class PersonRouteWithExtra extends GoRouteData with _$PersonRouteWithExtra {
PersonRouteWithExtra(this.$extra);
final Person? $extra;

Expand Down Expand Up @@ -281,7 +281,8 @@ You can, of course, combine the use of path, query and $extra parameters:
<?code-excerpt "example/lib/readme_excerpts.dart (HotdogRouteWithEverything)"?>
```dart
@TypedGoRoute<HotdogRouteWithEverything>(path: '/:ketchup')
class HotdogRouteWithEverything extends GoRouteData {
class HotdogRouteWithEverything extends GoRouteData
with _$HotdogRouteWithEverything {
HotdogRouteWithEverything(this.ketchup, this.mustard, this.$extra);
final bool ketchup; // A required path parameter.
final String? mustard; // An optional query parameter.
Expand Down