Skip to content

Commit 69e6dac

Browse files
authored
[go_router_builder] Generate replace method in RouteExtension (flutter#2838)
* [go_router_builder] pushReplacement method added * [go_router_builder] pushReplacement method added to builder test input
1 parent f2d802d commit 69e6dac

File tree

7 files changed

+68
-1
lines changed

7 files changed

+68
-1
lines changed

packages/go_router_builder/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.1.1
2+
3+
* Support for the generation of the pushReplacement method has been added.
4+
15
## 1.1.0
26

37
* Supports default value for the route parameters.

packages/go_router_builder/example/lib/all_types.g.dart

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/go_router_builder/example/lib/main.g.dart

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/go_router_builder/example/lib/simple_example.g.dart

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/go_router_builder/lib/src/route_config.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ extension $_extensionName on $_className {
145145
void go(BuildContext context) => context.go(location, extra: this);
146146
147147
void push(BuildContext context) => context.push(location, extra: this);
148+
149+
void pushReplacement(BuildContext context) =>
150+
context.pushReplacement(location, extra: this);
148151
}
149152
''';
150153

packages/go_router_builder/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: go_router_builder
22
description: >-
33
A builder that supports generated strongly-typed route helpers for
44
package:go_router
5-
version: 1.1.0
5+
version: 1.1.1
66
repository: https://github.com/flutter/packages/tree/main/packages/go_router_builder
77
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router_builder%22
88

packages/go_router_builder/test/test_inputs/_go_router_builder_test_input.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ extension $EnumParamExtension on EnumParam {
8989
void go(BuildContext context) => context.go(location, extra: this);
9090
9191
void push(BuildContext context) => context.push(location, extra: this);
92+
93+
void pushReplacement(BuildContext context) =>
94+
context.pushReplacement(location, extra: this);
9295
}
9396
9497
const _$EnumTestEnumMap = {
@@ -138,6 +141,9 @@ extension $DefaultValueRouteExtension on DefaultValueRoute {
138141
void go(BuildContext context) => context.go(location, extra: this);
139142
140143
void push(BuildContext context) => context.push(location, extra: this);
144+
145+
void pushReplacement(BuildContext context) =>
146+
context.pushReplacement(location, extra: this);
141147
}
142148
143149
T? _$convertMapValue<T>(

0 commit comments

Comments
 (0)