mirror of
https://github.com/flutter/packages.git
synced 2025-06-28 05:37:17 +08:00
[in_app_purchase] Minor lint cleanup (#4818)
Updates some lints for current versions of Flutter, reducing the need for `// ignore`s. Fixes https://github.com/flutter/flutter/issues/131792
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
## 3.1.10
|
||||||
|
|
||||||
|
* Updates example code for current versions of Flutter.
|
||||||
|
|
||||||
## 3.1.9
|
## 3.1.9
|
||||||
|
|
||||||
* Adds pub topics to package metadata.
|
* Adds pub topics to package metadata.
|
||||||
|
@ -164,10 +164,8 @@ class _MyAppState extends State<_MyApp> {
|
|||||||
}
|
}
|
||||||
if (_purchasePending) {
|
if (_purchasePending) {
|
||||||
stack.add(
|
stack.add(
|
||||||
// TODO(goderbauer): Make this const when that's available on stable.
|
const Stack(
|
||||||
// ignore: prefer_const_constructors
|
children: <Widget>[
|
||||||
Stack(
|
|
||||||
children: const <Widget>[
|
|
||||||
Opacity(
|
Opacity(
|
||||||
opacity: 0.3,
|
opacity: 0.3,
|
||||||
child: ModalBarrier(dismissible: false, color: Colors.grey),
|
child: ModalBarrier(dismissible: false, color: Colors.grey),
|
||||||
|
@ -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.
|
description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play.
|
||||||
repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase
|
repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase
|
||||||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
|
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
|
||||||
version: 3.1.9
|
version: 3.1.10
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <4.0.0"
|
sdk: ">=2.19.0 <4.0.0"
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
## 0.3.0+13
|
||||||
|
|
||||||
|
* Updates example code for current versions of Flutter.
|
||||||
|
|
||||||
## 0.3.0+12
|
## 0.3.0+12
|
||||||
|
|
||||||
* Adds pub topics to package metadata.
|
* Adds pub topics to package metadata.
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
// ignore_for_file: avoid_print
|
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -156,10 +154,8 @@ class _MyAppState extends State<_MyApp> {
|
|||||||
}
|
}
|
||||||
if (_purchasePending) {
|
if (_purchasePending) {
|
||||||
stack.add(
|
stack.add(
|
||||||
// TODO(goderbauer): Make this const when that's available on stable.
|
const Stack(
|
||||||
// ignore: prefer_const_constructors
|
children: <Widget>[
|
||||||
Stack(
|
|
||||||
children: const <Widget>[
|
|
||||||
Opacity(
|
Opacity(
|
||||||
opacity: 0.3,
|
opacity: 0.3,
|
||||||
child: ModalBarrier(dismissible: false, color: Colors.grey),
|
child: ModalBarrier(dismissible: false, color: Colors.grey),
|
||||||
|
@ -22,7 +22,6 @@ class InAppPurchaseAndroidPlatformAddition
|
|||||||
/// this is handled internally and the [enablePendingPurchase] property will
|
/// this is handled internally and the [enablePendingPurchase] property will
|
||||||
/// always return `true`.
|
/// always return `true`.
|
||||||
///
|
///
|
||||||
// ignore: deprecated_member_use_from_same_package
|
|
||||||
/// See also [enablePendingPurchases] for more on pending purchases.
|
/// See also [enablePendingPurchases] for more on pending purchases.
|
||||||
@Deprecated(
|
@Deprecated(
|
||||||
'The requirement to call `enablePendingPurchases()` has become obsolete '
|
'The requirement to call `enablePendingPurchases()` has become obsolete '
|
||||||
|
@ -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.
|
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/packages/tree/main/packages/in_app_purchase/in_app_purchase_android
|
repository: https://github.com/flutter/packages/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
|
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
|
||||||
version: 0.3.0+12
|
version: 0.3.0+13
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <4.0.0"
|
sdk: ">=2.19.0 <4.0.0"
|
||||||
|
@ -33,7 +33,6 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test(
|
test(
|
||||||
// ignore: lines_longer_than_80_chars
|
|
||||||
'Default implementation of purchaseStream should throw unimplemented error',
|
'Default implementation of purchaseStream should throw unimplemented error',
|
||||||
() {
|
() {
|
||||||
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
|
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
|
||||||
@ -46,7 +45,6 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test(
|
test(
|
||||||
// ignore: lines_longer_than_80_chars
|
|
||||||
'Default implementation of isAvailable should throw unimplemented error',
|
'Default implementation of isAvailable should throw unimplemented error',
|
||||||
() {
|
() {
|
||||||
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
|
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
|
||||||
@ -59,7 +57,6 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test(
|
test(
|
||||||
// ignore: lines_longer_than_80_chars
|
|
||||||
'Default implementation of queryProductDetails should throw unimplemented error',
|
'Default implementation of queryProductDetails should throw unimplemented error',
|
||||||
() {
|
() {
|
||||||
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
|
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
|
||||||
@ -72,7 +69,6 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test(
|
test(
|
||||||
// ignore: lines_longer_than_80_chars
|
|
||||||
'Default implementation of buyNonConsumable should throw unimplemented error',
|
'Default implementation of buyNonConsumable should throw unimplemented error',
|
||||||
() {
|
() {
|
||||||
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
|
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
|
||||||
@ -87,7 +83,6 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test(
|
test(
|
||||||
// ignore: lines_longer_than_80_chars
|
|
||||||
'Default implementation of buyConsumable should throw unimplemented error',
|
'Default implementation of buyConsumable should throw unimplemented error',
|
||||||
() {
|
() {
|
||||||
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
|
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
|
||||||
@ -102,7 +97,6 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test(
|
test(
|
||||||
// ignore: lines_longer_than_80_chars
|
|
||||||
'Default implementation of completePurchase should throw unimplemented error',
|
'Default implementation of completePurchase should throw unimplemented error',
|
||||||
() {
|
() {
|
||||||
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
|
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
|
||||||
@ -115,7 +109,6 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test(
|
test(
|
||||||
// ignore: lines_longer_than_80_chars
|
|
||||||
'Default implementation of restorePurchases should throw unimplemented error',
|
'Default implementation of restorePurchases should throw unimplemented error',
|
||||||
() {
|
() {
|
||||||
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
|
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
## 0.3.6+7
|
||||||
|
|
||||||
|
* Updates example code for current versions of Flutter.
|
||||||
|
|
||||||
## 0.3.6+6
|
## 0.3.6+6
|
||||||
|
|
||||||
* Adds pub topics to package metadata.
|
* Adds pub topics to package metadata.
|
||||||
|
@ -156,10 +156,8 @@ class _MyAppState extends State<_MyApp> {
|
|||||||
}
|
}
|
||||||
if (_purchasePending) {
|
if (_purchasePending) {
|
||||||
stack.add(
|
stack.add(
|
||||||
// TODO(goderbauer): Make this const when that's available on stable.
|
const Stack(
|
||||||
// ignore: prefer_const_constructors
|
children: <Widget>[
|
||||||
Stack(
|
|
||||||
children: const <Widget>[
|
|
||||||
Opacity(
|
Opacity(
|
||||||
opacity: 0.3,
|
opacity: 0.3,
|
||||||
child: ModalBarrier(dismissible: false, color: Colors.grey),
|
child: ModalBarrier(dismissible: false, color: Colors.grey),
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
// ignore_for_file: avoid_print
|
|
||||||
|
|
||||||
import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart';
|
import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart';
|
||||||
import '../in_app_purchase_storekit.dart';
|
import '../in_app_purchase_storekit.dart';
|
||||||
|
|
||||||
@ -31,6 +29,7 @@ class InAppPurchaseStoreKitPlatformAddition
|
|||||||
serverVerificationData: receipt,
|
serverVerificationData: receipt,
|
||||||
source: kIAPSource);
|
source: kIAPSource);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
// ignore: avoid_print
|
||||||
print(
|
print(
|
||||||
'Something is wrong while fetching the receipt, this normally happens when the app is '
|
'Something is wrong while fetching the receipt, this normally happens when the app is '
|
||||||
'running on a simulator: $e');
|
'running on a simulator: $e');
|
||||||
|
@ -2,7 +2,7 @@ name: in_app_purchase_storekit
|
|||||||
description: An implementation for the iOS and macOS platforms of the Flutter `in_app_purchase` plugin. This uses the StoreKit Framework.
|
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
|
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
|
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+6
|
version: 0.3.6+7
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <4.0.0"
|
sdk: ">=2.19.0 <4.0.0"
|
||||||
|
@ -163,8 +163,6 @@ class FakeStoreKitPlatform {
|
|||||||
return Future<void>.sync(() {});
|
return Future<void>.sync(() {});
|
||||||
case '-[InAppPurchasePlugin retrieveReceiptData:result:]':
|
case '-[InAppPurchasePlugin retrieveReceiptData:result:]':
|
||||||
if (receiptData != null) {
|
if (receiptData != null) {
|
||||||
// TODO(asashour): Remove the `ignore` when Dart 3 reaches stable.
|
|
||||||
// ignore: unnecessary_null_checks
|
|
||||||
return Future<String>.value(receiptData!);
|
return Future<String>.value(receiptData!);
|
||||||
} else {
|
} else {
|
||||||
throw PlatformException(code: 'no_receipt_data');
|
throw PlatformException(code: 'no_receipt_data');
|
||||||
|
Reference in New Issue
Block a user