Apple IAP

This commit is contained in:
Hillel Coren 2022-07-13 17:43:07 +03:00
parent ca9541026b
commit df33d4523a
1 changed files with 4 additions and 8 deletions

View File

@ -203,30 +203,26 @@ class _UpgradeDialogState extends State<UpgradeDialog> {
} }
return MapEntry<String, PurchaseDetails>(purchase.productID, purchase); return MapEntry<String, PurchaseDetails>(purchase.productID, purchase);
})); }));
_products.sort((p1, p2) => p1.rawPrice.compareTo(p2.rawPrice));
productList.addAll(_products.map( productList.addAll(_products.map(
(ProductDetails productDetails) { (ProductDetails productDetails) {
final PurchaseDetails previousPurchase = purchases[productDetails.id]; final PurchaseDetails previousPurchase = purchases[productDetails.id];
String title = productDetails.title;
String description = productDetails.description; String description = productDetails.description;
// TODO remove this code // TODO remove this code
// Workaround for product in app store with blank values // Workaround for product in app store with blank values
if (title.isEmpty && productDetails.id == kProductEnterprisePlanMonth_10) { if (description.isEmpty && productDetails.id == kProductEnterprisePlanMonth_10) {
title = 'Enterprise - Month (6-10)';
description = 'One month of the Enterprise Plan (10 users)'; description = 'One month of the Enterprise Plan (10 users)';
} }
return ListTile( return ListTile(
title: Text( title: Text(
title description
), ),
subtitle: Column( subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(
description
),
previousPurchase != null previousPurchase != null
? IconButton( ? IconButton(
onPressed: () => confirmPriceChange(context), onPressed: () => confirmPriceChange(context),