diff --git a/packages/in_app_purchase/in_app_purchase_platform_interface/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_platform_interface/CHANGELOG.md index 15978f3756ef..ec619d2fdc37 100644 --- a/packages/in_app_purchase/in_app_purchase_platform_interface/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.0 + +* Added `currencySymbol` in ProductDetails. + ## 1.0.1 * Fixed `Restoring previous purchases` link. diff --git a/packages/in_app_purchase/in_app_purchase_platform_interface/lib/src/types/product_details.dart b/packages/in_app_purchase/in_app_purchase_platform_interface/lib/src/types/product_details.dart index 2d82d04ae71e..aa03a41b4776 100644 --- a/packages/in_app_purchase/in_app_purchase_platform_interface/lib/src/types/product_details.dart +++ b/packages/in_app_purchase/in_app_purchase_platform_interface/lib/src/types/product_details.dart @@ -12,6 +12,7 @@ class ProductDetails { required this.price, required this.rawPrice, required this.currencyCode, + this.currencySymbol = '', }); /// The identifier of the product. @@ -42,4 +43,9 @@ class ProductDetails { /// The currency code for the price of the product. /// Based on the price specified in the App Store Connect or Sku in Google Play console based on the platform. final String currencyCode; + + /// The currency symbol for the locale, e.g. $ for US locale. + /// + /// When the currency symbol cannot be determined, the ISO 4217 currency code is returned. + final String currencySymbol; } diff --git a/packages/in_app_purchase/in_app_purchase_platform_interface/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_platform_interface/pubspec.yaml index a5be5a005e2c..d15e5f40fc6f 100644 --- a/packages/in_app_purchase/in_app_purchase_platform_interface/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/plugins/tree/master/packages/in_app_purch issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 1.0.1 +version: 1.1.0 environment: sdk: ">=2.12.0 <3.0.0" diff --git a/packages/in_app_purchase/in_app_purchase_platform_interface/test/src/types/product_details_test.dart b/packages/in_app_purchase/in_app_purchase_platform_interface/test/src/types/product_details_test.dart index d6cbce04c64a..ce49d9992131 100644 --- a/packages/in_app_purchase/in_app_purchase_platform_interface/test/src/types/product_details_test.dart +++ b/packages/in_app_purchase/in_app_purchase_platform_interface/test/src/types/product_details_test.dart @@ -16,6 +16,7 @@ void main() { description: 'description', price: '13.37', currencyCode: 'USD', + currencySymbol: r'$', rawPrice: 13.37); expect(productDetails.id, 'id'); @@ -23,6 +24,7 @@ void main() { expect(productDetails.description, 'description'); expect(productDetails.rawPrice, 13.37); expect(productDetails.currencyCode, 'USD'); + expect(productDetails.currencySymbol, r'$'); }); }); }