[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:
stuartmorgan
2023-08-30 10:38:04 -07:00
committed by GitHub
parent 200e3c6cb3
commit 1f208aa264
13 changed files with 22 additions and 29 deletions

View File

@ -1,3 +1,7 @@
## 3.1.10
* Updates example code for current versions of Flutter.
## 3.1.9
* Adds pub topics to package metadata.

View File

@ -164,10 +164,8 @@ class _MyAppState extends State<_MyApp> {
}
if (_purchasePending) {
stack.add(
// TODO(goderbauer): Make this const when that's available on stable.
// ignore: prefer_const_constructors
Stack(
children: const <Widget>[
const Stack(
children: <Widget>[
Opacity(
opacity: 0.3,
child: ModalBarrier(dismissible: false, color: Colors.grey),

View File

@ -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.
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
version: 3.1.9
version: 3.1.10
environment:
sdk: ">=2.19.0 <4.0.0"

View File

@ -1,3 +1,7 @@
## 0.3.0+13
* Updates example code for current versions of Flutter.
## 0.3.0+12
* Adds pub topics to package metadata.

View File

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// ignore_for_file: avoid_print
import 'dart:async';
import 'package:flutter/material.dart';
@ -156,10 +154,8 @@ class _MyAppState extends State<_MyApp> {
}
if (_purchasePending) {
stack.add(
// TODO(goderbauer): Make this const when that's available on stable.
// ignore: prefer_const_constructors
Stack(
children: const <Widget>[
const Stack(
children: <Widget>[
Opacity(
opacity: 0.3,
child: ModalBarrier(dismissible: false, color: Colors.grey),

View File

@ -22,7 +22,6 @@ class InAppPurchaseAndroidPlatformAddition
/// this is handled internally and the [enablePendingPurchase] property will
/// always return `true`.
///
// ignore: deprecated_member_use_from_same_package
/// See also [enablePendingPurchases] for more on pending purchases.
@Deprecated(
'The requirement to call `enablePendingPurchases()` has become obsolete '

View File

@ -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.
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
version: 0.3.0+12
version: 0.3.0+13
environment:
sdk: ">=2.19.0 <4.0.0"

View File

@ -33,7 +33,6 @@ void main() {
});
test(
// ignore: lines_longer_than_80_chars
'Default implementation of purchaseStream should throw unimplemented error',
() {
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
@ -46,7 +45,6 @@ void main() {
});
test(
// ignore: lines_longer_than_80_chars
'Default implementation of isAvailable should throw unimplemented error',
() {
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
@ -59,7 +57,6 @@ void main() {
});
test(
// ignore: lines_longer_than_80_chars
'Default implementation of queryProductDetails should throw unimplemented error',
() {
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
@ -72,7 +69,6 @@ void main() {
});
test(
// ignore: lines_longer_than_80_chars
'Default implementation of buyNonConsumable should throw unimplemented error',
() {
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
@ -87,7 +83,6 @@ void main() {
});
test(
// ignore: lines_longer_than_80_chars
'Default implementation of buyConsumable should throw unimplemented error',
() {
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
@ -102,7 +97,6 @@ void main() {
});
test(
// ignore: lines_longer_than_80_chars
'Default implementation of completePurchase should throw unimplemented error',
() {
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
@ -115,7 +109,6 @@ void main() {
});
test(
// ignore: lines_longer_than_80_chars
'Default implementation of restorePurchases should throw unimplemented error',
() {
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =

View File

@ -1,3 +1,7 @@
## 0.3.6+7
* Updates example code for current versions of Flutter.
## 0.3.6+6
* Adds pub topics to package metadata.

View File

@ -156,10 +156,8 @@ class _MyAppState extends State<_MyApp> {
}
if (_purchasePending) {
stack.add(
// TODO(goderbauer): Make this const when that's available on stable.
// ignore: prefer_const_constructors
Stack(
children: const <Widget>[
const Stack(
children: <Widget>[
Opacity(
opacity: 0.3,
child: ModalBarrier(dismissible: false, color: Colors.grey),

View File

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// ignore_for_file: avoid_print
import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart';
import '../in_app_purchase_storekit.dart';
@ -31,6 +29,7 @@ class InAppPurchaseStoreKitPlatformAddition
serverVerificationData: receipt,
source: kIAPSource);
} catch (e) {
// ignore: avoid_print
print(
'Something is wrong while fetching the receipt, this normally happens when the app is '
'running on a simulator: $e');

View File

@ -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.
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+6
version: 0.3.6+7
environment:
sdk: ">=2.19.0 <4.0.0"

View File

@ -163,8 +163,6 @@ class FakeStoreKitPlatform {
return Future<void>.sync(() {});
case '-[InAppPurchasePlugin retrieveReceiptData:result:]':
if (receiptData != null) {
// 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');