Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions packages/go_router_builder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.2.1

- Changes generated whitespace for better compatibility with new Dart formatter.

## 3.2.0

- Adds support for`extension type`.
Expand Down
32 changes: 17 additions & 15 deletions packages/go_router_builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ The tree of routes is defined as an attribute on each of the top-level routes:
@TypedGoRoute<HomeRoute>(
path: '/',
routes: <TypedGoRoute<GoRouteData>>[
TypedGoRoute<FamilyRoute>(
path: 'family/:fid',
),
TypedGoRoute<FamilyRoute>(path: 'family/:fid'),
],
)
class HomeRoute extends GoRouteData with _$HomeRoute {
Expand Down Expand Up @@ -200,8 +198,9 @@ a return value. The generated routes also follow this functionality.

<?code-excerpt "example/lib/readme_excerpts.dart (awaitPush)"?>
```dart
final bool? result =
await const FamilyRoute(fid: 'John').push<bool>(context);
final bool? result = await const FamilyRoute(
fid: 'John',
).push<bool>(context);
```

## Query parameters
Expand Down Expand Up @@ -376,10 +375,7 @@ class MyMaterialRouteWithKey extends GoRouteData with _$MyMaterialRouteWithKey {
static const LocalKey _key = ValueKey<String>('my-route-with-key');
@override
MaterialPage<void> buildPage(BuildContext context, GoRouterState state) {
return const MaterialPage<void>(
key: _key,
child: MyPage(),
);
return const MaterialPage<void>(key: _key, child: MyPage());
}
}
```
Expand All @@ -398,12 +394,17 @@ class FancyRoute extends GoRouteData with _$FancyRoute {
GoRouterState state,
) {
return CustomTransitionPage<void>(
key: state.pageKey,
child: const MyPage(),
transitionsBuilder: (BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation, Widget child) {
return RotationTransition(turns: animation, child: child);
});
key: state.pageKey,
child: const MyPage(),
transitionsBuilder: (
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
Widget child,
) {
return RotationTransition(turns: animation, child: child);
},
);
}
}
```
Expand Down Expand Up @@ -449,6 +450,7 @@ class MyGoRouteData extends GoRouteData with _$MyGoRouteData {
@override
Widget build(BuildContext context, GoRouterState state) => const MyPage();
}

```

An example is available [here](https://github.com/flutter/packages/blob/main/packages/go_router_builder/example/lib/shell_route_with_keys_example.dart).
Expand Down
Loading