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