Skip to content

Commit 7ab117b

Browse files
authored
[in_app_purchase] Upgrade to latest version and add 'countryCode' API (#827)
1 parent 30003f1 commit 7ab117b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+25470
-1329
lines changed

packages/in_app_purchase/CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
## NEXT
1+
## 0.1.1
22

33
* Fix new lint warnings.
44
* Update minimum Flutter and Dart version to 3.13 and 3.1.
5+
* Update in_app_purchase_platform_interface to 1.4.0.
6+
* Add countryCode API.
57

68
## 0.1.0
79

8-
* Initial release.
10+
* Initial release.

packages/in_app_purchase/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The Tizen implementation of [`in_app_purchase`](https://pub.dev/packages/in_app_
44

55
## Supported devices
66

7-
This plugin is only supported on Samsung Smart TVs running Tizen 5.5 and above.
7+
This plugin is only supported on Samsung Smart TVs running Tizen 6.0 and above.
88

99
## Required privileges
1010

@@ -34,8 +34,8 @@ This package is not an _endorsed_ implementation of `in_app_purchase`. Therefore
3434

3535
```yaml
3636
dependencies:
37-
in_app_purchase: ^3.1.4
38-
in_app_purchase_tizen: ^0.1.0
37+
in_app_purchase: ^3.2.1
38+
in_app_purchase_tizen: ^0.1.1
3939
```
4040
4141
Then you can import `in_app_purchase` and `in_app_purchase_tizen` in your Dart code:

packages/in_app_purchase/example/lib/main.dart

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'dart:async';
66

77
import 'package:flutter/material.dart';
88
import 'package:in_app_purchase/in_app_purchase.dart';
9-
import 'package:in_app_purchase_tizen/billing_manager_wrappers.dart';
109
import 'package:in_app_purchase_tizen/in_app_purchase_tizen.dart';
1110

1211
void main() {
@@ -148,10 +147,8 @@ class _MyAppState extends State<_MyApp> {
148147
}
149148
if (_purchasePending) {
150149
stack.add(
151-
// TODO(goderbauer): Make this const when that's available on stable.
152-
// ignore: prefer_const_constructors
153-
Stack(
154-
children: const <Widget>[
150+
const Stack(
151+
children: <Widget>[
155152
Opacity(
156153
opacity: 0.3,
157154
child: ModalBarrier(dismissible: false, color: Colors.grey),
@@ -237,7 +234,10 @@ class _MyAppState extends State<_MyApp> {
237234
title: Text(productDetails.title),
238235
subtitle: Text(productDetails.description),
239236
trailing: TextButton(
240-
style: TextButton.styleFrom(backgroundColor: Colors.green[800]),
237+
style: TextButton.styleFrom(
238+
backgroundColor: Colors.green[800],
239+
foregroundColor: Colors.white,
240+
),
241241
onPressed: () {
242242
final PurchaseParam purchaseParam = PurchaseParam(
243243
productDetails: productDetails,
@@ -282,6 +282,7 @@ class _MyAppState extends State<_MyApp> {
282282
TextButton(
283283
style: TextButton.styleFrom(
284284
backgroundColor: Theme.of(context).colorScheme.primary,
285+
foregroundColor: Colors.white,
285286
),
286287
onPressed: () => _inAppPurchase.restorePurchases(),
287288
child: const Text('Restore purchases'),
@@ -297,7 +298,7 @@ class _MyAppState extends State<_MyApp> {
297298
});
298299
}
299300

300-
void deliverProduct(PurchaseDetails purchaseDetails) {
301+
Future<void> deliverProduct(PurchaseDetails purchaseDetails) async {
301302
// IMPORTANT!! Always verify purchase details before delivering the product.
302303
setState(() {
303304
_purchases.add(purchaseDetails);
@@ -339,7 +340,7 @@ class _MyAppState extends State<_MyApp> {
339340
purchaseDetails.status == PurchaseStatus.restored) {
340341
final bool valid = await _verifyPurchase(purchaseDetails);
341342
if (valid) {
342-
deliverProduct(purchaseDetails);
343+
unawaited(deliverProduct(purchaseDetails));
343344
} else {
344345
_handleInvalidPurchase(purchaseDetails);
345346
return;

packages/in_app_purchase/example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ environment:
99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
in_app_purchase: ^3.1.4
12+
in_app_purchase: ^3.2.1
1313
in_app_purchase_tizen:
1414
path: ../
1515

packages/in_app_purchase/lib/billing_manager_wrappers.dart

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/in_app_purchase/lib/in_app_purchase_tizen.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
export 'src/billing_manager.dart';
56
export 'src/in_app_purchase_tizen_platform.dart';
67
export 'src/in_app_purchase_tizen_platform_addition.dart';

0 commit comments

Comments
 (0)