File tree Expand file tree Collapse file tree 4 files changed +30
-2
lines changed
packages/in_app_purchase/in_app_purchase_platform_interface Expand file tree Collapse file tree 4 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 1+ ## 1.3.0
2+
3+ * Added new ` PurchaseStatus ` named ` canceled ` to distinguish between an error and user cancellation.
4+
15## 1.2.0
26
37* Added ` toString() ` to ` IAPError `
1216
1317## 1.0.0
1418
15- * Initial open-source release.
19+ * Initial open-source release.
Original file line number Diff line number Diff line change @@ -26,4 +26,9 @@ enum PurchaseStatus {
2626 /// the purchase by calling the `completePurchase` method. More information on
2727 /// verifying purchases can be found [here] (https://pub.dev/packages/in_app_purchase#restoring-previous-purchases).
2828 restored,
29+
30+ /// The purchase has been canceled.
31+ ///
32+ /// Update your UI to indicate the purchase is canceled.
33+ canceled,
2934}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ repository: https://github.com/flutter/plugins/tree/master/packages/in_app_purch
44issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
55# NOTE: We strongly prefer non-breaking changes, even at the expense of a
66# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
7- version : 1.2 .0
7+ version : 1.3 .0
88
99environment :
1010 sdk : " >=2.12.0 <3.0.0"
Original file line number Diff line number Diff line change 44
55import 'package:flutter_test/flutter_test.dart' ;
66import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart' ;
7+ import 'package:in_app_purchase_platform_interface/src/types/purchase_status.dart' ;
78
89void main () {
910 group ('Constructor Tests' , () {
@@ -27,4 +28,22 @@ void main() {
2728 expect (productDetails.currencySymbol, r'$' );
2829 });
2930 });
31+
32+ group ('PurchaseStatus Tests' , () {
33+ test ('PurchaseStatus should contain 5 options' , () {
34+ const List <PurchaseStatus > values = PurchaseStatus .values;
35+
36+ expect (values.length, 5 );
37+ });
38+
39+ test ('PurchaseStatus enum should have items in correct index' , () {
40+ const List <PurchaseStatus > values = PurchaseStatus .values;
41+
42+ expect (values[0 ], PurchaseStatus .pending);
43+ expect (values[1 ], PurchaseStatus .purchased);
44+ expect (values[2 ], PurchaseStatus .error);
45+ expect (values[3 ], PurchaseStatus .restored);
46+ expect (values[4 ], PurchaseStatus .canceled);
47+ });
48+ });
3049}
You can’t perform that action at this time.
0 commit comments