Adjust IAP UI

This commit is contained in:
Hillel Coren 2023-01-13 13:36:42 +02:00
parent 8081e2f5e7
commit bdaf652806
1 changed files with 30 additions and 37 deletions

View File

@ -228,45 +228,38 @@ class _UpgradeDialogState extends State<UpgradeDialog> {
return ListTile( return ListTile(
title: Text(productDetails.description), title: Text(productDetails.description),
subtitle: Column( trailing: TextButton(
crossAxisAlignment: CrossAxisAlignment.start, style: TextButton.styleFrom(
children: [ backgroundColor: Colors.green[800],
SizedBox(height: 4), // TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
TextButton( // ignore: deprecated_member_use
style: TextButton.styleFrom( primary: Colors.white,
backgroundColor: Colors.green[800], ),
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724 onPressed: () {
// ignore: deprecated_member_use if (previousPurchase != null) {
primary: Colors.white, confirmPriceChange(context);
), } else {
onPressed: () { PurchaseParam purchaseParam;
if (previousPurchase != null) {
confirmPriceChange(context);
} else {
PurchaseParam purchaseParam;
if (Platform.isAndroid) { if (Platform.isAndroid) {
purchaseParam = GooglePlayPurchaseParam( purchaseParam = GooglePlayPurchaseParam(
productDetails: productDetails, productDetails: productDetails,
applicationUserName: account.id); applicationUserName: account.id);
} else { } else {
purchaseParam = PurchaseParam( purchaseParam = PurchaseParam(
productDetails: productDetails, productDetails: productDetails,
applicationUserName: account.id, applicationUserName: account.id,
); );
} }
_inAppPurchase.buyNonConsumable( _inAppPurchase.buyNonConsumable(
purchaseParam: purchaseParam, purchaseParam: purchaseParam,
); );
} }
}, },
child: Text(previousPurchase != null child: Text(previousPurchase != null
? AppLocalization.of(context).activate ? AppLocalization.of(context).activate
: productDetails.price), : productDetails.price),
),
SizedBox(height: 20),
],
), ),
); );
}, },