chore: try to pull localized price string from revenuecat SDK on mobile (#2038)
This commit is contained in:
parent
b14353ea51
commit
9a16b01f0c
2 changed files with 3 additions and 1 deletions
|
|
@ -387,6 +387,7 @@ class SubscriptionDetails {
|
|||
final String id;
|
||||
SubscriptionPeriodType periodType;
|
||||
Package? package;
|
||||
String? localizedPrice;
|
||||
|
||||
SubscriptionDetails({
|
||||
required this.price,
|
||||
|
|
@ -402,7 +403,7 @@ class SubscriptionDetails {
|
|||
|
||||
String displayPrice(BuildContext context) => isTrial || price <= 0
|
||||
? L10n.of(context).freeTrial
|
||||
: "\$${price.toStringAsFixed(2)}";
|
||||
: localizedPrice ?? "\$${price.toStringAsFixed(2)}";
|
||||
|
||||
String displayName(BuildContext context) {
|
||||
if (isTrial) {
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ class MobileSubscriptionInfo extends CurrentSubscriptionInfo {
|
|||
final SubscriptionDetails updated =
|
||||
availableSubscriptionInfo.allProducts![productIndex];
|
||||
updated.package = package;
|
||||
updated.localizedPrice = package.storeProduct.priceString;
|
||||
availableSubscriptionInfo.allProducts![productIndex] = updated;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue