Skip to content
Merged
Show file tree
Hide file tree
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
Next Next commit
Update changelog and version
  • Loading branch information
LukasMirbt committed Aug 19, 2025
commit 609ec7492ffd712a7ebd04a3bd12eb0de392e27d
2 changes: 1 addition & 1 deletion packages/go_router_builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
dev_dependencies:
# ...along with your other dev-dependencies
build_runner: ^2.6.0
go_router_builder: ^3.1.0
go_router_builder: ^3.3.0
```

### Source code
Expand Down
39 changes: 14 additions & 25 deletions packages/go_router_builder/example/lib/go_relative.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,19 @@ class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return MaterialApp.router(
routerConfig: _router,
);
return MaterialApp.router(routerConfig: _router);
}
}

/// The route configuration.
final GoRouter _router = GoRouter(
routes: $appRoutes,
);
final GoRouter _router = GoRouter(routes: $appRoutes);
const TypedRelativeGoRoute<DetailsRoute> detailRoute =
TypedRelativeGoRoute<DetailsRoute>(
path: 'details/:detailId',
routes: <TypedRoute<RouteData>>[
TypedRelativeGoRoute<SettingsRoute>(path: 'settings/:settingId'),
],
);
path: 'details/:detailId',
routes: <TypedRoute<RouteData>>[
TypedRelativeGoRoute<SettingsRoute>(path: 'settings/:settingId'),
],
);

@TypedGoRoute<HomeRoute>(
path: '/',
Expand Down Expand Up @@ -71,9 +67,7 @@ class DetailsRoute extends RelativeGoRouteData with _$DetailsRoute {
}

class SettingsRoute extends RelativeGoRouteData with _$SettingsRoute {
const SettingsRoute({
required this.settingId,
});
const SettingsRoute({required this.settingId});
final String settingId;

@override
Expand Down Expand Up @@ -142,10 +136,7 @@ class DashboardScreen extends StatelessWidget {
/// The details screen
class DetailsScreen extends StatelessWidget {
/// Constructs a [DetailsScreen]
const DetailsScreen({
super.key,
required this.id,
});
const DetailsScreen({super.key, required this.id});

final String id;

Expand All @@ -161,9 +152,10 @@ class DetailsScreen extends StatelessWidget {
child: const Text('Go back'),
),
ElevatedButton(
onPressed: () => const SettingsRoute(
settingId: 'SettingsId',
).goRelative(context),
onPressed:
() => const SettingsRoute(
settingId: 'SettingsId',
).goRelative(context),
child: const Text('Go to the Settings screen'),
),
],
Expand All @@ -176,10 +168,7 @@ class DetailsScreen extends StatelessWidget {
/// The details screen
class SettingsScreen extends StatelessWidget {
/// Constructs a [SettingsScreen]
const SettingsScreen({
super.key,
required this.id,
});
const SettingsScreen({super.key, required this.id});

final String id;

Expand Down
72 changes: 34 additions & 38 deletions packages/go_router_builder/example/lib/go_relative.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,7 @@ class MyGoRouteData extends GoRouteData with _$MyGoRouteData {
// #enddocregion MyShellRouteData

// #docregion relativeRoute
@TypedRelativeGoRoute<DetailsRoute>(
path: 'details',
)
@TypedRelativeGoRoute<DetailsRoute>(path: 'details')
class DetailsRoute extends RelativeGoRouteData with _$DetailsRoute {
const DetailsRoute();

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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: 3.2.1
version: 3.3.0
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