diff --git a/packages/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/CHANGELOG.md index 2624cadd785d..451953d89974 100644 --- a/packages/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.2.2+3 + +* Fix failing pedantic lints. None of these fixes should have any change in + functionality. + ## 0.2.2+2 * Include lifecycle dependency as a compileOnly one on Android to resolve diff --git a/packages/in_app_purchase/analysis_options.yaml b/packages/in_app_purchase/analysis_options.yaml index 6a095d6e3a69..8e4af76f0a30 100644 --- a/packages/in_app_purchase/analysis_options.yaml +++ b/packages/in_app_purchase/analysis_options.yaml @@ -7,10 +7,4 @@ include: ../../analysis_options.yaml analyzer: errors: - avoid_init_to_null: ignore - prefer_is_empty: ignore - prefer_is_not_empty: ignore public_member_api_docs: ignore - type_init_formals: ignore - unnecessary_new: ignore - unawaited_futures: ignore diff --git a/packages/in_app_purchase/example/lib/main.dart b/packages/in_app_purchase/example/lib/main.dart index 729fc0f77f46..8d142c8c095b 100644 --- a/packages/in_app_purchase/example/lib/main.dart +++ b/packages/in_app_purchase/example/lib/main.dart @@ -36,7 +36,7 @@ class _MyAppState extends State { bool _isAvailable = false; bool _purchasePending = false; bool _loading = true; - String _queryProductError = null; + String _queryProductError; @override void initState() { @@ -149,12 +149,12 @@ class _MyAppState extends State { stack.add( Stack( children: [ - new Opacity( + Opacity( opacity: 0.3, child: const ModalBarrier(dismissible: false, color: Colors.grey), ), - new Center( - child: new CircularProgressIndicator(), + Center( + child: CircularProgressIndicator(), ), ], ), @@ -213,7 +213,7 @@ class _MyAppState extends State { title: Text('Products for Sale', style: Theme.of(context).textTheme.headline)); List productList = []; - if (!_notFoundIds.isEmpty) { + if (_notFoundIds.isNotEmpty) { productList.add(ListTile( title: Text('[${_notFoundIds.join(", ")}] not found', style: TextStyle(color: ThemeData.light().errorColor)), @@ -375,10 +375,12 @@ class _MyAppState extends State { } } if (Platform.isIOS) { - InAppPurchaseConnection.instance.completePurchase(purchaseDetails); + await InAppPurchaseConnection.instance + .completePurchase(purchaseDetails); } else if (Platform.isAndroid) { if (!kAutoConsume && purchaseDetails.productID == _kConsumableId) { - InAppPurchaseConnection.instance.consumePurchase(purchaseDetails); + await InAppPurchaseConnection.instance + .consumePurchase(purchaseDetails); } } } diff --git a/packages/in_app_purchase/example/test_driver/test/in_app_purchase_e2e_test.dart b/packages/in_app_purchase/example/test_driver/test/in_app_purchase_e2e_test.dart index d0a7005afa96..449af666b605 100644 --- a/packages/in_app_purchase/example/test_driver/test/in_app_purchase_e2e_test.dart +++ b/packages/in_app_purchase/example/test_driver/test/in_app_purchase_e2e_test.dart @@ -10,6 +10,6 @@ Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); final String result = await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); + await driver.close(); exit(result == 'pass' ? 0 : 1); } diff --git a/packages/in_app_purchase/lib/src/billing_client_wrappers/purchase_wrapper.dart b/packages/in_app_purchase/lib/src/billing_client_wrappers/purchase_wrapper.dart index e2bea9fc4d03..30f8732904b7 100644 --- a/packages/in_app_purchase/lib/src/billing_client_wrappers/purchase_wrapper.dart +++ b/packages/in_app_purchase/lib/src/billing_client_wrappers/purchase_wrapper.dart @@ -101,8 +101,7 @@ class PurchaseWrapper { @BillingResponseConverter() class PurchasesResultWrapper { PurchasesResultWrapper( - {@required BillingResponse this.responseCode, - @required List this.purchasesList}); + {@required this.responseCode, @required this.purchasesList}); factory PurchasesResultWrapper.fromJson(Map map) => _$PurchasesResultWrapperFromJson(map); diff --git a/packages/in_app_purchase/lib/src/in_app_purchase/app_store_connection.dart b/packages/in_app_purchase/lib/src/in_app_purchase/app_store_connection.dart index e6b8ac5e9e95..956eb09f6313 100644 --- a/packages/in_app_purchase/lib/src/in_app_purchase/app_store_connection.dart +++ b/packages/in_app_purchase/lib/src/in_app_purchase/app_store_connection.dart @@ -154,7 +154,7 @@ class AppStoreConnection implements InAppPurchaseConnection { .toList(); } List invalidIdentifiers = response.invalidProductIdentifiers ?? []; - if (productDetails.length == 0) { + if (productDetails.isEmpty) { invalidIdentifiers = identifiers.toList(); } ProductDetailsResponse productDetailsResponse = ProductDetailsResponse( diff --git a/packages/in_app_purchase/lib/src/in_app_purchase/google_play_connection.dart b/packages/in_app_purchase/lib/src/in_app_purchase/google_play_connection.dart index d64467ed3775..96a3d0c556b4 100644 --- a/packages/in_app_purchase/lib/src/in_app_purchase/google_play_connection.dart +++ b/packages/in_app_purchase/lib/src/in_app_purchase/google_play_connection.dart @@ -238,7 +238,7 @@ class GooglePlayConnection ..status = status ..error = error); }).toList(); - if (!purchases.isEmpty) { + if (purchases.isNotEmpty) { return Future.wait(purchases); } else { return [ diff --git a/packages/in_app_purchase/lib/src/in_app_purchase/in_app_purchase_connection.dart b/packages/in_app_purchase/lib/src/in_app_purchase/in_app_purchase_connection.dart index 46088b9b008f..73990e86d9bd 100644 --- a/packages/in_app_purchase/lib/src/in_app_purchase/in_app_purchase_connection.dart +++ b/packages/in_app_purchase/lib/src/in_app_purchase/in_app_purchase_connection.dart @@ -249,7 +249,7 @@ class IAPError { {@required this.source, @required this.code, @required this.message, - this.details = null}); + this.details}); /// Which source is the error on. final IAPSource source; diff --git a/packages/in_app_purchase/lib/src/in_app_purchase/product_details.dart b/packages/in_app_purchase/lib/src/in_app_purchase/product_details.dart index 2cfbb0c2299c..9808bba999fe 100644 --- a/packages/in_app_purchase/lib/src/in_app_purchase/product_details.dart +++ b/packages/in_app_purchase/lib/src/in_app_purchase/product_details.dart @@ -17,8 +17,8 @@ class ProductDetails { @required this.title, @required this.description, @required this.price, - this.skProduct = null, - this.skuDetail = null}); + this.skProduct, + this.skuDetail}); /// The identifier of the product, specified in App Store Connect or Sku in Google Play console. final String id; @@ -67,9 +67,7 @@ class ProductDetails { /// A list of [ProductDetails] can be obtained from the this response. class ProductDetailsResponse { ProductDetailsResponse( - {@required this.productDetails, - @required this.notFoundIDs, - this.error = null}); + {@required this.productDetails, @required this.notFoundIDs, this.error}); /// Each [ProductDetails] uniquely matches one valid identifier in [identifiers] of [InAppPurchaseConnection.queryProductDetails]. final List productDetails; diff --git a/packages/in_app_purchase/lib/src/in_app_purchase/purchase_details.dart b/packages/in_app_purchase/lib/src/in_app_purchase/purchase_details.dart index b980b01bfa46..d5e8612bd76d 100644 --- a/packages/in_app_purchase/lib/src/in_app_purchase/purchase_details.dart +++ b/packages/in_app_purchase/lib/src/in_app_purchase/purchase_details.dart @@ -142,8 +142,8 @@ class PurchaseDetails { @required this.productID, @required this.verificationData, @required this.transactionDate, - this.skPaymentTransaction = null, - this.billingClientPurchase = null, + this.skPaymentTransaction, + this.billingClientPurchase, }); /// Generate a [PurchaseDetails] object based on an iOS [SKTransactionWrapper] object. diff --git a/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart b/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart index a5084b5c80cb..eb3ed4a5ae30 100644 --- a/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart +++ b/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart @@ -35,7 +35,7 @@ class SKPaymentQueueWrapper { return _singleton; } - static final SKPaymentQueueWrapper _singleton = new SKPaymentQueueWrapper._(); + static final SKPaymentQueueWrapper _singleton = SKPaymentQueueWrapper._(); SKPaymentQueueWrapper._() { callbackChannel.setMethodCallHandler(_handleObserverCallbacks); diff --git a/packages/in_app_purchase/pubspec.yaml b/packages/in_app_purchase/pubspec.yaml index 73f0e4f8c3e2..0e618cd0d306 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.2+2 +version: 0.2.2+3 dependencies: