Skip to content

Commit 9a16b01

Browse files
authored
chore: try to pull localized price string from revenuecat SDK on mobile (#2038)
1 parent b14353e commit 9a16b01

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/pangea/subscription/controllers/subscription_controller.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ class SubscriptionDetails {
387387
final String id;
388388
SubscriptionPeriodType periodType;
389389
Package? package;
390+
String? localizedPrice;
390391

391392
SubscriptionDetails({
392393
required this.price,
@@ -402,7 +403,7 @@ class SubscriptionDetails {
402403

403404
String displayPrice(BuildContext context) => isTrial || price <= 0
404405
? L10n.of(context).freeTrial
405-
: "\$${price.toStringAsFixed(2)}";
406+
: localizedPrice ?? "\$${price.toStringAsFixed(2)}";
406407

407408
String displayName(BuildContext context) {
408409
if (isTrial) {

lib/pangea/subscription/models/mobile_subscriptions.dart

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class MobileSubscriptionInfo extends CurrentSubscriptionInfo {
5353
final SubscriptionDetails updated =
5454
availableSubscriptionInfo.allProducts![productIndex];
5555
updated.package = package;
56+
updated.localizedPrice = package.storeProduct.priceString;
5657
availableSubscriptionInfo.allProducts![productIndex] = updated;
5758
}
5859
}

0 commit comments

Comments
 (0)