Skip to content

Commit

Permalink
[in_app_purchase] Add currencySymbol to ProductDetails (flutter#4115)
Browse files Browse the repository at this point in the history
  • Loading branch information
renefloor authored and fotiDim committed Sep 13, 2021
1 parent cd5f38e commit 0da7eb1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
@@ -1,3 +1,7 @@
## 1.1.0

* Added `currencySymbol` in ProductDetails.

## 1.0.1

* Fixed `Restoring previous purchases` link.
Expand Down
Expand Up @@ -12,6 +12,7 @@ class ProductDetails {
required this.price,
required this.rawPrice,
required this.currencyCode,
this.currencySymbol = '',
});

/// The identifier of the product.
Expand Down Expand Up @@ -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;
}
Expand Up @@ -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"
Expand Down
Expand Up @@ -16,13 +16,15 @@ void main() {
description: 'description',
price: '13.37',
currencyCode: 'USD',
currencySymbol: r'$',
rawPrice: 13.37);

expect(productDetails.id, 'id');
expect(productDetails.title, 'title');
expect(productDetails.description, 'description');
expect(productDetails.rawPrice, 13.37);
expect(productDetails.currencyCode, 'USD');
expect(productDetails.currencySymbol, r'$');
});
});
}

0 comments on commit 0da7eb1

Please sign in to comment.