Skip to content

Commit

Permalink
[go_router_builder] Generate replace method in RouteExtension (flutte…
Browse files Browse the repository at this point in the history
…r#2838)

* [go_router_builder] pushReplacement method added

* [go_router_builder] pushReplacement method added to builder test input
  • Loading branch information
omensight committed Feb 21, 2023
1 parent f2d802d commit 69e6dac
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/go_router_builder/CHANGELOG.md
@@ -1,3 +1,7 @@
## 1.1.1

* Support for the generation of the pushReplacement method has been added.

## 1.1.0

* Supports default value for the route parameters.
Expand Down
33 changes: 33 additions & 0 deletions packages/go_router_builder/example/lib/all_types.g.dart

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

15 changes: 15 additions & 0 deletions packages/go_router_builder/example/lib/main.g.dart

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

6 changes: 6 additions & 0 deletions packages/go_router_builder/example/lib/simple_example.g.dart

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

3 changes: 3 additions & 0 deletions packages/go_router_builder/lib/src/route_config.dart
Expand Up @@ -145,6 +145,9 @@ extension $_extensionName on $_className {
void go(BuildContext context) => context.go(location, extra: this);
void push(BuildContext context) => context.push(location, extra: this);
void pushReplacement(BuildContext context) =>
context.pushReplacement(location, extra: this);
}
''';

Expand Down
2 changes: 1 addition & 1 deletion packages/go_router_builder/pubspec.yaml
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: 1.1.0
version: 1.1.1
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
Expand Up @@ -89,6 +89,9 @@ extension $EnumParamExtension on EnumParam {
void go(BuildContext context) => context.go(location, extra: this);
void push(BuildContext context) => context.push(location, extra: this);
void pushReplacement(BuildContext context) =>
context.pushReplacement(location, extra: this);
}
const _$EnumTestEnumMap = {
Expand Down Expand Up @@ -138,6 +141,9 @@ extension $DefaultValueRouteExtension on DefaultValueRoute {
void go(BuildContext context) => context.go(location, extra: this);
void push(BuildContext context) => context.push(location, extra: this);
void pushReplacement(BuildContext context) =>
context.pushReplacement(location, extra: this);
}
T? _$convertMapValue<T>(
Expand Down

0 comments on commit 69e6dac

Please sign in to comment.