diff --git a/lib/ionia/ionia_merchant.dart b/lib/ionia/ionia_merchant.dart index 16df62da7..1e3b764cc 100644 --- a/lib/ionia/ionia_merchant.dart +++ b/lib/ionia/ionia_merchant.dart @@ -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; + } } diff --git a/lib/src/screens/ionia/cards/ionia_buy_gift_card.dart b/lib/src/screens/ionia/cards/ionia_buy_gift_card.dart index 899b1387d..a7b3fa4a2 100644 --- a/lib/src/screens/ionia/cards/ionia_buy_gift_card.dart +++ b/lib/src/screens/ionia/cards/ionia_buy_gift_card.dart @@ -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, ), ) diff --git a/lib/src/screens/ionia/cards/ionia_manage_cards_page.dart b/lib/src/screens/ionia/cards/ionia_manage_cards_page.dart index 656b8676b..ba2e793eb 100644 --- a/lib/src/screens/ionia/cards/ionia_manage_cards_page.dart +++ b/lib/src/screens/ionia/cards/ionia_manage_cards_page.dart @@ -216,27 +216,13 @@ class _IoniaManageCardsPageBodyState extends State { 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,