Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/in_app_purchase/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 0 additions & 6 deletions packages/in_app_purchase/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 9 additions & 7 deletions packages/in_app_purchase/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class _MyAppState extends State<MyApp> {
bool _isAvailable = false;
bool _purchasePending = false;
bool _loading = true;
String _queryProductError = null;
String _queryProductError;

@override
void initState() {
Expand Down Expand Up @@ -149,12 +149,12 @@ class _MyAppState extends State<MyApp> {
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(),
),
],
),
Expand Down Expand Up @@ -213,7 +213,7 @@ class _MyAppState extends State<MyApp> {
title: Text('Products for Sale',
style: Theme.of(context).textTheme.headline));
List<ListTile> productList = <ListTile>[];
if (!_notFoundIds.isEmpty) {
if (_notFoundIds.isNotEmpty) {
productList.add(ListTile(
title: Text('[${_notFoundIds.join(", ")}] not found',
style: TextStyle(color: ThemeData.light().errorColor)),
Expand Down Expand Up @@ -375,10 +375,12 @@ class _MyAppState extends State<MyApp> {
}
}
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);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Future<void> 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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ class PurchaseWrapper {
@BillingResponseConverter()
class PurchasesResultWrapper {
PurchasesResultWrapper(
{@required BillingResponse this.responseCode,
@required List<PurchaseWrapper> this.purchasesList});
{@required this.responseCode, @required this.purchasesList});

factory PurchasesResultWrapper.fromJson(Map<String, dynamic> map) =>
_$PurchasesResultWrapperFromJson(map);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class AppStoreConnection implements InAppPurchaseConnection {
.toList();
}
List<String> invalidIdentifiers = response.invalidProductIdentifiers ?? [];
if (productDetails.length == 0) {
if (productDetails.isEmpty) {
invalidIdentifiers = identifiers.toList();
}
ProductDetailsResponse productDetailsResponse = ProductDetailsResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class GooglePlayConnection
..status = status
..error = error);
}).toList();
if (!purchases.isEmpty) {
if (purchases.isNotEmpty) {
return Future.wait(purchases);
} else {
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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> productDetails;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SKPaymentQueueWrapper {
return _singleton;
}

static final SKPaymentQueueWrapper _singleton = new SKPaymentQueueWrapper._();
static final SKPaymentQueueWrapper _singleton = SKPaymentQueueWrapper._();

SKPaymentQueueWrapper._() {
callbackChannel.setMethodCallHandler(_handleObserverCallbacks);
Expand Down
2 changes: 1 addition & 1 deletion packages/in_app_purchase/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase
version: 0.2.2+2
version: 0.2.2+3


dependencies:
Expand Down