Skip to content

Commit d98f78a

Browse files
committed
update README
1 parent a522d15 commit d98f78a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packages/go_router_builder/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ method.
8686

8787
<?code-excerpt "example/lib/readme_excerpts.dart (HomeRoute)"?>
8888
```dart
89-
class HomeRoute extends GoRouteData {
89+
class HomeRoute extends GoRouteData with _$HomeRoute {
9090
const HomeRoute();
9191
9292
@override
@@ -108,7 +108,7 @@ The tree of routes is defined as an attribute on each of the top-level routes:
108108
),
109109
],
110110
)
111-
class HomeRoute extends GoRouteData {
111+
class HomeRoute extends GoRouteData with _$HomeRoute {
112112
const HomeRoute();
113113
114114
@override
@@ -124,7 +124,7 @@ class RedirectRoute extends GoRouteData {
124124
}
125125
126126
@TypedGoRoute<LoginRoute>(path: '/login')
127-
class LoginRoute extends GoRouteData {
127+
class LoginRoute extends GoRouteData with _$LoginRoute {
128128
LoginRoute({this.from});
129129
final String? from;
130130
@@ -211,7 +211,7 @@ Parameters (named or positional) not listed in the path of `TypedGoRoute` indica
211211
<?code-excerpt "example/lib/readme_excerpts.dart (login)"?>
212212
```dart
213213
@TypedGoRoute<LoginRoute>(path: '/login')
214-
class LoginRoute extends GoRouteData {
214+
class LoginRoute extends GoRouteData with _$LoginRoute {
215215
LoginRoute({this.from});
216216
final String? from;
217217
@@ -229,7 +229,7 @@ For query parameters with a **non-nullable** type, you can define a default valu
229229
<?code-excerpt "example/lib/readme_excerpts.dart (MyRoute)"?>
230230
```dart
231231
@TypedGoRoute<MyRoute>(path: '/my-route')
232-
class MyRoute extends GoRouteData {
232+
class MyRoute extends GoRouteData with _$MyRoute {
233233
MyRoute({this.queryParameter = 'defaultValue'});
234234
final String queryParameter;
235235
@@ -250,7 +250,7 @@ parameter with the special name `$extra`:
250250

251251
<?code-excerpt "example/lib/readme_excerpts.dart (PersonRouteWithExtra)"?>
252252
```dart
253-
class PersonRouteWithExtra extends GoRouteData {
253+
class PersonRouteWithExtra extends GoRouteData with _$PersonRouteWithExtra {
254254
PersonRouteWithExtra(this.$extra);
255255
final Person? $extra;
256256
@@ -281,7 +281,8 @@ You can, of course, combine the use of path, query and $extra parameters:
281281
<?code-excerpt "example/lib/readme_excerpts.dart (HotdogRouteWithEverything)"?>
282282
```dart
283283
@TypedGoRoute<HotdogRouteWithEverything>(path: '/:ketchup')
284-
class HotdogRouteWithEverything extends GoRouteData {
284+
class HotdogRouteWithEverything extends GoRouteData
285+
with _$HotdogRouteWithEverything {
285286
HotdogRouteWithEverything(this.ketchup, this.mustard, this.$extra);
286287
final bool ketchup; // A required path parameter.
287288
final String? mustard; // An optional query parameter.

0 commit comments

Comments
 (0)