chore: try to pull localized price string from revenuecat SDK on mobile (#2038)

This commit is contained in:
ggurdin 2025-03-04 15:55:31 -05:00 committed by GitHub
parent b14353ea51
commit 9a16b01f0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -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) {

View file

@ -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;
}
}