Skip to content

Commit

Permalink
update extra
Browse files Browse the repository at this point in the history
This reverts commit 36213a4.

remove extra

update log

update tests

update

Update CHANGELOG.md

lint

lint
  • Loading branch information
hangyujin committed Dec 27, 2022
1 parent 6d22f59 commit 1d2a3ba
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 42 deletions.
4 changes: 4 additions & 0 deletions packages/go_router_builder/CHANGELOG.md
@@ -1,3 +1,7 @@
## 1.0.16

* Update router_config to not passing `extra` unconditionally.

## 1.0.15

* Avoids using deprecated DartType.element2.
Expand Down
66 changes: 44 additions & 22 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.

2 changes: 1 addition & 1 deletion packages/go_router_builder/example/lib/main.dart
Expand Up @@ -232,7 +232,7 @@ class PersonScreen extends StatelessWidget {
person.id,
entry.key,
$extra: ++_extraClickCount,
).go(context),
).go(context, extra: _extraClickCount),
child: const Text('With extra...'),
),
onTap: () => PersonDetailsRoute(family.id, person.id, entry.key)
Expand Down
30 changes: 20 additions & 10 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.

12 changes: 8 additions & 4 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.

6 changes: 4 additions & 2 deletions packages/go_router_builder/lib/src/route_config.dart
Expand Up @@ -142,9 +142,11 @@ extension $_extensionName on $_className {
String get location => GoRouteData.\$location($_locationArgs,$_locationQueryParams);
void go(BuildContext context) => context.go(location, extra: this);
void go(BuildContext context, {Object? extra}) =>
context.go(location, extra: extra);
void push(BuildContext context) => context.push(location, extra: this);
void push(BuildContext context, {Object? extra}) =>
context.push(location, extra: extra);
}
''';

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.0.15
version: 1.0.16
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 @@ -86,9 +86,11 @@ extension $EnumParamExtension on EnumParam {
'/${Uri.encodeComponent(_$EnumTestEnumMap[y]!)}',
);
void go(BuildContext context) => context.go(location, extra: this);
void go(BuildContext context, {Object? extra}) =>
context.go(location, extra: extra);
void push(BuildContext context) => context.push(location, extra: this);
void push(BuildContext context, {Object? extra}) =>
context.push(location, extra: extra);
}
const _$EnumTestEnumMap = {
Expand Down

0 comments on commit 1d2a3ba

Please sign in to comment.