diff --git a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md index 2f37f09478c8..6f476436b3d6 100644 --- a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.3+1 + +* Updates `json_serializable` to fix warnings in generated code. + ## 0.2.3 * Upgrades Google Play Billing Library to 5.0 diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/purchase_wrapper.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/purchase_wrapper.dart index af1aaa5d556a..4e6b953096e2 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/purchase_wrapper.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/purchase_wrapper.dart @@ -106,6 +106,7 @@ class PurchaseWrapper { /// The product ID of this purchase. @Deprecated('Use skus instead') + @JsonKey(ignore: true) String get sku => _sku ?? (skus.isNotEmpty ? skus.first : ''); final String? _sku; @@ -209,6 +210,7 @@ class PurchaseHistoryRecordWrapper { /// The product ID of this purchase. @Deprecated('Use skus instead') + @JsonKey(ignore: true) String get sku => _sku ?? (skus.isNotEmpty ? skus.first : ''); final String? _sku; diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/purchase_wrapper.g.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/purchase_wrapper.g.dart index 7f6fd0f61d94..ad2a909fbfdc 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/purchase_wrapper.g.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/purchase_wrapper.g.dart @@ -12,10 +12,9 @@ PurchaseWrapper _$PurchaseWrapperFromJson(Map json) => PurchaseWrapper( purchaseTime: json['purchaseTime'] as int? ?? 0, purchaseToken: json['purchaseToken'] as String? ?? '', signature: json['signature'] as String? ?? '', - skus: json['skus'] != null - ? (json['skus'] as List)?.map((item) => item as String)?.toList() ?? - [] - : [], + skus: + (json['skus'] as List?)?.map((e) => e as String).toList() ?? + [], isAutoRenewing: json['isAutoRenewing'] as bool, originalJson: json['originalJson'] as String? ?? '', developerPayload: json['developerPayload'] as String?, @@ -31,10 +30,9 @@ PurchaseHistoryRecordWrapper _$PurchaseHistoryRecordWrapperFromJson(Map json) => purchaseTime: json['purchaseTime'] as int? ?? 0, purchaseToken: json['purchaseToken'] as String? ?? '', signature: json['signature'] as String? ?? '', - skus: json['skus'] != null - ? (json['skus'] as List)?.map((item) => item as String)?.toList() ?? - [] - : [], + skus: + (json['skus'] as List?)?.map((e) => e as String).toList() ?? + [], originalJson: json['originalJson'] as String? ?? '', developerPayload: json['developerPayload'] as String?, ); diff --git a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml index db419b8e1aa4..84bd36a8096b 100644 --- a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml @@ -2,7 +2,7 @@ name: in_app_purchase_android description: An implementation for the Android platform of the Flutter `in_app_purchase` plugin. This uses the Android BillingClient APIs. repository: https://github.com/flutter/plugins/tree/main/packages/in_app_purchase/in_app_purchase_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22 -version: 0.2.3 +version: 0.2.3+1 environment: sdk: ">=2.14.0 <3.0.0" @@ -21,12 +21,12 @@ dependencies: flutter: sdk: flutter in_app_purchase_platform_interface: ^1.3.0 - json_annotation: ^4.3.0 + json_annotation: ^4.6.0 dev_dependencies: build_runner: ^2.0.0 flutter_test: sdk: flutter - json_serializable: ^6.0.0 + json_serializable: ^6.3.1 mockito: ^5.1.0 test: ^1.16.0