[in_app_purchase] Prepare for `NULLABLE_ARGUMENT_TO_NON_NULL_TYPE` (#3275)
[in_app_purchase] Prepare for `NULLABLE_ARGUMENT_TO_NON_NULL_TYPE`
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 874a46b..5692382 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.3.6+3
+
+* Adds a null check, to prevent a new diagnostic.
+
## 0.3.6+2
* Clarifies explanation of endorsement in README.
@@ -13,7 +17,7 @@
## 0.3.5+2
-* Fix a crash when `appStoreReceiptURL` is nil.
+* Fixes a crash when `appStoreReceiptURL` is nil.
## 0.3.5+1
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 4d4454b..79a41cb 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.3.6+2
+version: 0.3.6+3
environment:
sdk: ">=2.18.0 <4.0.0"
diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart
index e636916..010e4f4 100644
--- a/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart
+++ b/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart
@@ -163,7 +163,9 @@
return Future<void>.sync(() {});
case '-[InAppPurchasePlugin retrieveReceiptData:result:]':
if (receiptData != null) {
- return Future<String>.value(receiptData);
+ // TODO(asashour): Remove the `ignore` when Dart 3 reaches stable.
+ // ignore: unnecessary_null_checks
+ return Future<String>.value(receiptData!);
} else {
throw PlatformException(code: 'no_receipt_data');
}