mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 01:37:40 +00:00
Update avaibility status for ionia merch. (#443)
This commit is contained in:
parent
418c9563fe
commit
b777dd9e7b
3 changed files with 21 additions and 16 deletions
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:cake_wallet/ionia/ionia_gift_card_instruction.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
|
||||
class IoniaMerchant {
|
||||
IoniaMerchant({
|
||||
|
@ -172,5 +173,23 @@ class IoniaMerchant {
|
|||
final double savingsPercentage;
|
||||
|
||||
double get discount => savingsPercentage;
|
||||
|
||||
String get avaibilityStatus {
|
||||
var status = '';
|
||||
|
||||
if (isOnline) {
|
||||
status += S.current.online;
|
||||
}
|
||||
|
||||
if (isPhysical) {
|
||||
if (status.isNotEmpty) {
|
||||
status = '$status & ';
|
||||
}
|
||||
|
||||
status = '${status}${S.current.in_store}';
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ class IoniaBuyGiftCardPage extends BasePage {
|
|||
discount: merchant.discount,
|
||||
titleColor: Theme.of(context).accentTextTheme.display4.backgroundColor,
|
||||
subtitleColor: Theme.of(context).hintColor,
|
||||
subTitle: merchant.isOnline ? S.of(context).online : S.of(context).offline,
|
||||
subTitle: merchant.avaibilityStatus,
|
||||
logoUrl: merchant.logoUrl,
|
||||
),
|
||||
)
|
||||
|
|
|
@ -216,27 +216,13 @@ class _IoniaManageCardsPageBodyState extends State<IoniaManageCardsPageBody> {
|
|||
separatorBuilder: (_, __) => SizedBox(height: 4),
|
||||
itemBuilder: (_, 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(
|
||||
logoUrl: merchant.logoUrl,
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(Routes.ioniaBuyGiftCardPage, arguments: [merchant]);
|
||||
},
|
||||
title: merchant.legalName,
|
||||
subTitle: subTitle,
|
||||
subTitle: merchant.avaibilityStatus,
|
||||
backgroundColor: Theme.of(context).textTheme.title.backgroundColor,
|
||||
titleColor: Theme.of(context).accentTextTheme.display3.backgroundColor,
|
||||
subtitleColor: Theme.of(context).accentTextTheme.display2.backgroundColor,
|
||||
|
|
Loading…
Reference in a new issue