Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 3 additions & 9 deletions packages/go_router_builder/test_inputs/shell_route_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@

import 'package:go_router/go_router.dart';

@TypedShellRoute<ShellRouteNoConstConstructor>(
routes: <TypedRoute<RouteData>>[],
)
@TypedShellRoute<ShellRouteNoConstConstructor>()
class ShellRouteNoConstConstructor extends ShellRouteData {}

@TypedShellRoute<ShellRouteWithConstConstructor>(
routes: <TypedRoute<RouteData>>[],
)
@TypedShellRoute<ShellRouteWithConstConstructor>()
class ShellRouteWithConstConstructor extends ShellRouteData {
const ShellRouteWithConstConstructor();
}

@TypedShellRoute<ShellRouteWithRestorationScopeId>(
routes: <TypedRoute<RouteData>>[],
)
@TypedShellRoute<ShellRouteWithRestorationScopeId>()
class ShellRouteWithRestorationScopeId extends ShellRouteData {
const ShellRouteWithRestorationScopeId();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

import 'package:go_router/go_router.dart';

@TypedShellRoute<ShellRouteWithoutUnnamedConstructor>(
routes: <TypedRoute<RouteData>>[],
)
@TypedShellRoute<ShellRouteWithoutUnnamedConstructor>()
class ShellRouteWithoutUnnamedConstructor extends ShellRouteData {
const ShellRouteWithoutUnnamedConstructor.namedConstructor();
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.4.5

* Makes `SKError.userInfo` key non-nullable to comply with json serialization requirements.

## 0.4.4+1

* Removes code for versions of iOS older than 13.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class _SerializedEnums {
late SKPaymentTransactionStateWrapper response;
late SKSubscriptionPeriodUnit unit;
late SKProductDiscountPaymentMode discountPaymentMode;
late SKProductDiscountType discountType;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @LouiseHsu this class doesn't seem to be read by anyone, and the code generator seems to be generating _$SKProductDiscountTypeEnumMap just fine without it being added to _SerializedEnums. Do you think this type can be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and the code generator seems to be generating _$SKProductDiscountTypeEnumMap just fine without it being added to _SerializedEnums.

I couldn't do without it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with json_serializable.dart, but the following code already exists in enum_converters.g.dart today:

const _$SKProductDiscountTypeEnumMap = {
  SKProductDiscountType.introductory: 0,
  SKProductDiscountType.subscription: 1,
};

you mean if you rerun code gen the above map const is removed from the generated source code, without that new field in _SerializedEnums?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean if you rerun code gen the above map const is removed from the generated source code, without that new field

Exactly. See the second commit on this branch, I simply ran the build and pushed, expecting any diagnostics to be stale analysis that would get fixed once it was updated. Once I saw the bots failed, I actually looked at the output and diagnostics.

So I had to add that and remove the ? from the map key for it to build. It was also warning on the terminal (while building) about the annotations version, so I upgraded it as well.

I'm not sure why this line was missing, if it was removed by mistake or something, but it would not generate this without it.

}

/// Serializer for [SKProductDiscountType].
Expand Down

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 @@ -378,7 +378,7 @@ class SKError {
///
/// Any key of the map must be a valid [NSErrorUserInfoKey](https://developer.apple.com/documentation/foundation/nserroruserinfokey?language=objc).
@JsonKey(defaultValue: <String, dynamic>{})
final Map<String?, Object?>? userInfo;
final Map<String, Object?>? userInfo;

@override
bool operator ==(Object other) {
Expand Down

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

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 @@ -384,7 +384,7 @@ class SKProductDiscountWrapper {
/// A string used to uniquely identify a discount offer for a product.
///
/// You set up offers and their identifiers in App Store Connect.
@JsonKey(defaultValue: null)
@JsonKey()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Thanks for removing the redundant defaultValue: null. However, it looks like the corresponding generated file, sk_product_wrapper.g.dart, hasn't been updated. As noted in the file header, changes to @JsonSerializable classes require running the build runner. Please run the generator and commit the updated .g.dart file to ensure the generated code is in sync with this change.

final String? identifier;

/// Values representing the types of discount offers an app can present.
Expand Down

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 @@ -2,7 +2,7 @@ name: in_app_purchase_storekit
description: An implementation for the iOS and macOS platforms of the Flutter `in_app_purchase` plugin. This uses the StoreKit Framework.
repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_storekit
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 0.4.4+1
version: 0.4.5

environment:
sdk: ^3.9.0
Expand All @@ -24,7 +24,7 @@ dependencies:
flutter:
sdk: flutter
in_app_purchase_platform_interface: ^1.4.0
json_annotation: ^4.3.0
json_annotation: ^4.9.0

dev_dependencies:
build_runner: ^2.0.0
Expand Down