[go_router_builder] Changes the parameter name of the auto-generated go method from buildContext to context (#1635)
diff --git a/packages/go_router_builder/CHANGELOG.md b/packages/go_router_builder/CHANGELOG.md
index 3cd0996..895e962 100644
--- a/packages/go_router_builder/CHANGELOG.md
+++ b/packages/go_router_builder/CHANGELOG.md
@@ -1,6 +1,6 @@
-## NEXT
+## 1.0.2
-- Fixes integration tests. [#102799](https://github.com/flutter/flutter/issues/102799).
+- Changes the parameter name of the auto-generated `go` method from `buildContext` to `context`.
## 1.0.1
diff --git a/packages/go_router_builder/example/lib/all_types.g.dart b/packages/go_router_builder/example/lib/all_types.g.dart
index eba107f..be1d211 100644
--- a/packages/go_router_builder/example/lib/all_types.g.dart
+++ b/packages/go_router_builder/example/lib/all_types.g.dart
@@ -64,7 +64,7 @@
},
);
- void go(BuildContext buildContext) => buildContext.go(location, extra: this);
+ void go(BuildContext context) => context.go(location, extra: this);
}
const _$PersonDetailsEnumMap = {
diff --git a/packages/go_router_builder/example/lib/main.g.dart b/packages/go_router_builder/example/lib/main.g.dart
index ffef1b2..50931d5 100644
--- a/packages/go_router_builder/example/lib/main.g.dart
+++ b/packages/go_router_builder/example/lib/main.g.dart
@@ -43,7 +43,7 @@
'/',
);
- void go(BuildContext buildContext) => buildContext.go(location, extra: this);
+ void go(BuildContext context) => context.go(location, extra: this);
}
extension $FamilyRouteExtension on FamilyRoute {
@@ -55,7 +55,7 @@
'/family/${Uri.encodeComponent(fid)}',
);
- void go(BuildContext buildContext) => buildContext.go(location, extra: this);
+ void go(BuildContext context) => context.go(location, extra: this);
}
extension $PersonRouteExtension on PersonRoute {
@@ -68,7 +68,7 @@
'/family/${Uri.encodeComponent(fid)}/person/${Uri.encodeComponent(pid.toString())}',
);
- void go(BuildContext buildContext) => buildContext.go(location, extra: this);
+ void go(BuildContext context) => context.go(location, extra: this);
}
extension $PersonDetailsRouteExtension on PersonDetailsRoute {
@@ -84,7 +84,7 @@
'/family/${Uri.encodeComponent(fid)}/person/${Uri.encodeComponent(pid.toString())}/details/${Uri.encodeComponent(_$PersonDetailsEnumMap[details]!)}',
);
- void go(BuildContext buildContext) => buildContext.go(location, extra: this);
+ void go(BuildContext context) => context.go(location, extra: this);
}
const _$PersonDetailsEnumMap = {
@@ -115,5 +115,5 @@
},
);
- void go(BuildContext buildContext) => buildContext.go(location, extra: this);
+ void go(BuildContext context) => context.go(location, extra: this);
}
diff --git a/packages/go_router_builder/example/lib/simple_example.g.dart b/packages/go_router_builder/example/lib/simple_example.g.dart
index 0608e6f..7b78e19 100644
--- a/packages/go_router_builder/example/lib/simple_example.g.dart
+++ b/packages/go_router_builder/example/lib/simple_example.g.dart
@@ -30,7 +30,7 @@
'/',
);
- void go(BuildContext buildContext) => buildContext.go(location, extra: this);
+ void go(BuildContext context) => context.go(location, extra: this);
}
extension $FamilyRouteExtension on FamilyRoute {
@@ -42,5 +42,5 @@
'/family/${Uri.encodeComponent(familyId)}',
);
- void go(BuildContext buildContext) => buildContext.go(location, extra: this);
+ void go(BuildContext context) => context.go(location, extra: this);
}
diff --git a/packages/go_router_builder/lib/src/route_config.dart b/packages/go_router_builder/lib/src/route_config.dart
index e945e46..fd1110d 100644
--- a/packages/go_router_builder/lib/src/route_config.dart
+++ b/packages/go_router_builder/lib/src/route_config.dart
@@ -136,11 +136,11 @@
String _extensionDefinition() => '''
extension $_extensionName on $_className {
static $_className _fromState(GoRouterState state) $_newFromState
-
+
String get location => GoRouteData.\$location($_locationArgs,$_locationQueryParams);
-
- void go(BuildContext buildContext) => buildContext.go(location, extra: this);
-}
+
+ void go(BuildContext context) => context.go(location, extra: this);
+}
''';
/// Returns this [RouteConfig] and all child [RouteConfig] instances.
diff --git a/packages/go_router_builder/pubspec.yaml b/packages/go_router_builder/pubspec.yaml
index a72a4f5..d894a05 100644
--- a/packages/go_router_builder/pubspec.yaml
+++ b/packages/go_router_builder/pubspec.yaml
@@ -2,7 +2,7 @@
description: >-
A builder that supports generated strongly-typed route helpers for
package:go_router
-version: 1.0.1
+version: 1.0.2
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