diff --git a/packages/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/CHANGELOG.md index be8d4d5c9cf4..32f56899826e 100644 --- a/packages/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.0+3 + +* Update the `README.md` so that the code samples compile with the latest Flutter/Dart version. + ## 0.2.0+2 * Fix a google_play_connection purchase update listener regression introduced in 0.2.0+1. diff --git a/packages/in_app_purchase/README.md b/packages/in_app_purchase/README.md index 24584850474c..3b8d1a4df04c 100644 --- a/packages/in_app_purchase/README.md +++ b/packages/in_app_purchase/README.md @@ -62,7 +62,7 @@ class _MyAppState extends State { void initState() { final Stream purchaseUpdates = InAppPurchaseConnection.instance.purchaseUpdatedStream; - _subscription = purchaseUpdates.listen((List purchases) { + _subscription = purchaseUpdates.listen((purchases) { _handlePurchaseUpdates(purchases); }); super.initState(); @@ -87,9 +87,9 @@ if (!available) { ### Loading products for sale ```dart -const Set _kIds = ['product1', 'product2'].toSet(); +Set _kIds = ['product1', 'product2'].toSet(); final ProductDetailsResponse response = await InAppPurchaseConnection.instance.queryProductDetails(_kIds); -if (!response.notFoundIds.isEmpty()) { +if (!response.notFoundIDs.isEmpty) { // Handle the error. } List products = response.productDetails; @@ -102,7 +102,7 @@ final QueryPurchaseDetailsResponse response = await InAppPurchaseConnection.inst if (response.error != null) { // Handle the error. } -for (PurchaseDetails purchase : repsonse.pastPurchases) { +for (PurchaseDetails purchase in response.pastPurchases) { _verifyPurchase(purchase); // Verify the purchase following the best practices for each storefront. _deliverPurchase(purchase); // Deliver the purchase to the user in your app. if (Platform.isIOS) { diff --git a/packages/in_app_purchase/pubspec.yaml b/packages/in_app_purchase/pubspec.yaml index 75d187389ea5..3987990e1c77 100644 --- a/packages/in_app_purchase/pubspec.yaml +++ b/packages/in_app_purchase/pubspec.yaml @@ -2,7 +2,7 @@ name: in_app_purchase description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase -version: 0.2.0+2 +version: 0.2.0+3 dependencies: async: ^2.0.8