mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-09 04:19:36 +00:00
Update for discounts and statuses for ionia merch.
This commit is contained in:
parent
0c8caf8847
commit
8bd66b64e7
5 changed files with 25 additions and 6 deletions
|
@ -168,5 +168,7 @@ class IoniaMerchant {
|
||||||
final String acceptedCurrency;
|
final String acceptedCurrency;
|
||||||
final String deepLink;
|
final String deepLink;
|
||||||
final bool isPayLater;
|
final bool isPayLater;
|
||||||
|
|
||||||
|
double get discount => level3;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,8 +35,8 @@ class IoniaBuyGiftCardDetailPage extends BasePage {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget trailing(BuildContext context)
|
Widget trailing(BuildContext context)
|
||||||
=> ioniaPurchaseViewModel.ioniaMerchant.minimumDiscount > 0
|
=> ioniaPurchaseViewModel.ioniaMerchant.discount > 0
|
||||||
? DiscountBadge(percentage: ioniaPurchaseViewModel.ioniaMerchant.minimumDiscount)
|
? DiscountBadge(percentage: ioniaPurchaseViewModel.ioniaMerchant.discount)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -130,7 +130,7 @@ class IoniaBuyGiftCardDetailPage extends BasePage {
|
||||||
),
|
),
|
||||||
SizedBox(height: 4),
|
SizedBox(height: 4),
|
||||||
Text(
|
Text(
|
||||||
'\$${ioniaPurchaseViewModel.amount.toStringAsFixed(2)}',
|
'\$${ioniaPurchaseViewModel.billAmount.toStringAsFixed(2)}',
|
||||||
style: textLargeSemiBold(),
|
style: textLargeSemiBold(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -146,7 +146,7 @@ class IoniaBuyGiftCardPage extends BasePage {
|
||||||
child: CardItem(
|
child: CardItem(
|
||||||
title: merchant.legalName,
|
title: merchant.legalName,
|
||||||
backgroundColor: Theme.of(context).accentTextTheme.display4.backgroundColor.withOpacity(0.1),
|
backgroundColor: Theme.of(context).accentTextTheme.display4.backgroundColor.withOpacity(0.1),
|
||||||
discount: merchant.minimumDiscount,
|
discount: merchant.discount,
|
||||||
titleColor: Theme.of(context).accentTextTheme.display4.backgroundColor,
|
titleColor: Theme.of(context).accentTextTheme.display4.backgroundColor,
|
||||||
subtitleColor: Theme.of(context).hintColor,
|
subtitleColor: Theme.of(context).hintColor,
|
||||||
subTitle: merchant.isOnline ? S.of(context).online : S.of(context).offline,
|
subTitle: merchant.isOnline ? S.of(context).online : S.of(context).offline,
|
||||||
|
|
|
@ -216,17 +216,31 @@ class _IoniaManageCardsPageBodyState extends State<IoniaManageCardsPageBody> {
|
||||||
separatorBuilder: (_, __) => SizedBox(height: 4),
|
separatorBuilder: (_, __) => SizedBox(height: 4),
|
||||||
itemBuilder: (_, index) {
|
itemBuilder: (_, index) {
|
||||||
final merchant = merchantsList[index];
|
final merchant = merchantsList[index];
|
||||||
|
var subTitle = '';
|
||||||
|
|
||||||
|
if (merchant.isOnline) {
|
||||||
|
subTitle += S.of(context).online;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (merchant.isPhysical) {
|
||||||
|
if (subTitle.isNotEmpty) {
|
||||||
|
subTitle = '$subTitle & ';
|
||||||
|
}
|
||||||
|
|
||||||
|
subTitle = '${subTitle}${S.of(context).in_store}';
|
||||||
|
}
|
||||||
|
|
||||||
return CardItem(
|
return CardItem(
|
||||||
logoUrl: merchant.logoUrl,
|
logoUrl: merchant.logoUrl,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.of(context).pushNamed(Routes.ioniaBuyGiftCardPage, arguments: [merchant]);
|
Navigator.of(context).pushNamed(Routes.ioniaBuyGiftCardPage, arguments: [merchant]);
|
||||||
},
|
},
|
||||||
title: merchant.legalName,
|
title: merchant.legalName,
|
||||||
subTitle: merchant.isOnline ? S.of(context).online : S.of(context).offline,
|
subTitle: subTitle,
|
||||||
backgroundColor: Theme.of(context).textTheme.title.backgroundColor,
|
backgroundColor: Theme.of(context).textTheme.title.backgroundColor,
|
||||||
titleColor: Theme.of(context).accentTextTheme.display3.backgroundColor,
|
titleColor: Theme.of(context).accentTextTheme.display3.backgroundColor,
|
||||||
subtitleColor: Theme.of(context).accentTextTheme.display2.backgroundColor,
|
subtitleColor: Theme.of(context).accentTextTheme.display2.backgroundColor,
|
||||||
discount: merchant.minimumDiscount,
|
discount: merchant.discount,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
@ -58,6 +58,9 @@ abstract class IoniaMerchPurchaseViewModelBase with Store {
|
||||||
@computed
|
@computed
|
||||||
double get giftCardAmount => double.parse((amount + tipAmount).toStringAsFixed(2));
|
double get giftCardAmount => double.parse((amount + tipAmount).toStringAsFixed(2));
|
||||||
|
|
||||||
|
@computed
|
||||||
|
double get billAmount => double.parse((giftCardAmount * (1 - (ioniaMerchant.discount / 100))).toStringAsFixed(2));
|
||||||
|
|
||||||
@observable
|
@observable
|
||||||
double tipAmount;
|
double tipAmount;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue