Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[in_app_purchase] Add currencySymbol to ProductDetails #4115

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.1.0

* Added `currencySymbol` in ProductDetails.

## 1.0.1

* Fixed `Restoring previous purchases` link.
Expand Down
Original file line number Diff line number Diff line change
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,7 @@ 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.
final String currencySymbol;
}
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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'$');
});
});
}