[go_router_builder] [in_app_purchase_storekit] Removes redundant arguments from annotations (#9964)

It was found, at the issue below, a false-negative for the `avoid_redundant_argument_values` lint where it wasn't triggered for annotations. This PR simply removes the redundant arguments.

- https://github.com/dart-lang/sdk/issues/61456

## Pre-Review Checklist

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
diff --git a/packages/go_router_builder/test_inputs/shell_route_data.dart b/packages/go_router_builder/test_inputs/shell_route_data.dart
index b4839d9..2b6f5bb 100644
--- a/packages/go_router_builder/test_inputs/shell_route_data.dart
+++ b/packages/go_router_builder/test_inputs/shell_route_data.dart
@@ -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();
 
diff --git a/packages/go_router_builder/test_inputs/shell_route_data_without_unnamed_constructor.dart b/packages/go_router_builder/test_inputs/shell_route_data_without_unnamed_constructor.dart
index 24e97bf..23ea2a4 100644
--- a/packages/go_router_builder/test_inputs/shell_route_data_without_unnamed_constructor.dart
+++ b/packages/go_router_builder/test_inputs/shell_route_data_without_unnamed_constructor.dart
@@ -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();
 }
diff --git a/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md
index f31e13d..c5cfa3b 100644
--- a/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md
+++ b/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md
@@ -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.
diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/enum_converters.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/enum_converters.dart
index 6fb12ee..0c7ad0a 100644
--- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/enum_converters.dart
+++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/enum_converters.dart
@@ -121,6 +121,7 @@
   late SKPaymentTransactionStateWrapper response;
   late SKSubscriptionPeriodUnit unit;
   late SKProductDiscountPaymentMode discountPaymentMode;
+  late SKProductDiscountType discountType;
 }
 
 /// Serializer for [SKProductDiscountType].
diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/enum_converters.g.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/enum_converters.g.dart
index a4c3d60..25a4d28 100644
--- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/enum_converters.g.dart
+++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/enum_converters.g.dart
@@ -15,6 +15,10 @@
   ..discountPaymentMode = $enumDecode(
     _$SKProductDiscountPaymentModeEnumMap,
     json['discountPaymentMode'],
+  )
+  ..discountType = $enumDecode(
+    _$SKProductDiscountTypeEnumMap,
+    json['discountType'],
   );
 
 const _$SKPaymentTransactionStateWrapperEnumMap = {
diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart
index c5ba0f0..054c94d 100644
--- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart
+++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart
@@ -378,7 +378,7 @@
   ///
   /// 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) {
diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.g.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.g.dart
index 7dbd5b8..9e8080c 100644
--- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.g.dart
+++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.g.dart
@@ -7,7 +7,7 @@
 // **************************************************************************
 
 SKError _$SKErrorFromJson(Map json) => SKError(
-  code: json['code'] as int? ?? 0,
+  code: (json['code'] as num?)?.toInt() ?? 0,
   domain: json['domain'] as String? ?? '',
   userInfo:
       (json['userInfo'] as Map?)?.map((k, e) => MapEntry(k as String, e)) ?? {},
@@ -17,9 +17,14 @@
   productIdentifier: json['productIdentifier'] as String? ?? '',
   applicationUsername: json['applicationUsername'] as String?,
   requestData: json['requestData'] as String?,
-  quantity: json['quantity'] as int? ?? 0,
+  quantity: (json['quantity'] as num?)?.toInt() ?? 0,
   simulatesAskToBuyInSandbox:
       json['simulatesAskToBuyInSandbox'] as bool? ?? false,
+  paymentDiscount: json['paymentDiscount'] == null
+      ? null
+      : SKPaymentDiscountWrapper.fromJson(
+          Map<String, dynamic>.from(json['paymentDiscount'] as Map),
+        ),
 );
 
 Map<String, dynamic> _$SKPaymentWrapperToJson(SKPaymentWrapper instance) =>
@@ -29,6 +34,7 @@
       'requestData': instance.requestData,
       'quantity': instance.quantity,
       'simulatesAskToBuyInSandbox': instance.simulatesAskToBuyInSandbox,
+      'paymentDiscount': instance.paymentDiscount,
     };
 
 SKPaymentDiscountWrapper _$SKPaymentDiscountWrapperFromJson(Map json) =>
@@ -37,7 +43,7 @@
       keyIdentifier: json['keyIdentifier'] as String,
       nonce: json['nonce'] as String,
       signature: json['signature'] as String,
-      timestamp: json['timestamp'] as int,
+      timestamp: (json['timestamp'] as num).toInt(),
     );
 
 Map<String, dynamic> _$SKPaymentDiscountWrapperToJson(
diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_transaction_wrappers.g.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_transaction_wrappers.g.dart
index 48d8e5b..6aaf956 100644
--- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_transaction_wrappers.g.dart
+++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_transaction_wrappers.g.dart
@@ -12,7 +12,7 @@
         Map<String, dynamic>.from(json['payment'] as Map),
       ),
       transactionState: const SKTransactionStatusConverter().fromJson(
-        json['transactionState'] as int?,
+        (json['transactionState'] as num?)?.toInt(),
       ),
       originalTransaction: json['originalTransaction'] == null
           ? null
diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.dart
index 2b6f8ec..424bb9f 100644
--- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.dart
+++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.dart
@@ -384,7 +384,7 @@
   /// 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()
   final String? identifier;
 
   /// Values representing the types of discount offers an app can present.
diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.g.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.g.dart
index 0423d5e..acbfb2d 100644
--- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.g.dart
+++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.g.dart
@@ -27,9 +27,9 @@
 SKProductSubscriptionPeriodWrapper _$SKProductSubscriptionPeriodWrapperFromJson(
   Map json,
 ) => SKProductSubscriptionPeriodWrapper(
-  numberOfUnits: json['numberOfUnits'] as int? ?? 0,
+  numberOfUnits: (json['numberOfUnits'] as num?)?.toInt() ?? 0,
   unit: const SKSubscriptionPeriodUnitConverter().fromJson(
-    json['unit'] as int?,
+    (json['unit'] as num?)?.toInt(),
   ),
 );
 
@@ -39,18 +39,18 @@
       priceLocale: SKPriceLocaleWrapper.fromJson(
         (json['priceLocale'] as Map?)?.map((k, e) => MapEntry(k as String, e)),
       ),
-      numberOfPeriods: json['numberOfPeriods'] as int? ?? 0,
+      numberOfPeriods: (json['numberOfPeriods'] as num?)?.toInt() ?? 0,
       paymentMode: const SKProductDiscountPaymentModeConverter().fromJson(
-        json['paymentMode'] as int?,
+        (json['paymentMode'] as num?)?.toInt(),
       ),
       subscriptionPeriod: SKProductSubscriptionPeriodWrapper.fromJson(
         (json['subscriptionPeriod'] as Map?)?.map(
           (k, e) => MapEntry(k as String, e),
         ),
       ),
-      identifier: json['identifier'] as String? ?? null,
+      identifier: json['identifier'] as String?,
       type: const SKProductDiscountTypeConverter().fromJson(
-        json['type'] as int?,
+        (json['type'] as num?)?.toInt(),
       ),
     );
 
diff --git a/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml
index 20bdd5e..83f72e9 100644
--- a/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml
+++ b/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml
@@ -2,7 +2,7 @@
 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
@@ -24,7 +24,7 @@
   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