Skip to content

Commit

Permalink
[in_app_purchase] Minor lint cleanup (#4818)
Browse files Browse the repository at this point in the history
Updates some lints for current versions of Flutter, reducing the need for `// ignore`s.

Fixes flutter/flutter#131792
  • Loading branch information
stuartmorgan authored Aug 30, 2023
1 parent 200e3c6 commit 1f208aa
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 29 deletions.
4 changes: 4 additions & 0 deletions packages/in_app_purchase/in_app_purchase/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.1.10

* Updates example code for current versions of Flutter.

## 3.1.9

* Adds pub topics to package metadata.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion packages/in_app_purchase/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.
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"
Expand Down
4 changes: 4 additions & 0 deletions packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ void main() {
});

test(
// ignore: lines_longer_than_80_chars
'Default implementation of purchaseStream should throw unimplemented error',
() {
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
Expand All @@ -46,7 +45,6 @@ void main() {
});

test(
// ignore: lines_longer_than_80_chars
'Default implementation of isAvailable should throw unimplemented error',
() {
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
Expand All @@ -59,7 +57,6 @@ void main() {
});

test(
// ignore: lines_longer_than_80_chars
'Default implementation of queryProductDetails should throw unimplemented error',
() {
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
Expand All @@ -72,7 +69,6 @@ void main() {
});

test(
// ignore: lines_longer_than_80_chars
'Default implementation of buyNonConsumable should throw unimplemented error',
() {
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
Expand All @@ -87,7 +83,6 @@ void main() {
});

test(
// ignore: lines_longer_than_80_chars
'Default implementation of buyConsumable should throw unimplemented error',
() {
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
Expand All @@ -102,7 +97,6 @@ void main() {
});

test(
// ignore: lines_longer_than_80_chars
'Default implementation of completePurchase should throw unimplemented error',
() {
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
Expand All @@ -115,7 +109,6 @@ void main() {
});

test(
// ignore: lines_longer_than_80_chars
'Default implementation of restorePurchases should throw unimplemented error',
() {
final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 1f208aa

Please sign in to comment.