Merge branch 'ionia' of github.com:cake-tech/cake_wallet into ionia

This commit is contained in:
M 2022-07-20 18:34:13 +01:00
commit 720caa630a
17 changed files with 27 additions and 76 deletions

View file

@ -1,7 +1,6 @@
import 'dart:ui'; import 'dart:ui';
import 'package:cake_wallet/anypay/any_pay_payment_committed_info.dart'; import 'package:cake_wallet/anypay/any_pay_payment_committed_info.dart';
import 'package:cake_wallet/core/execution_state.dart'; import 'package:cake_wallet/core/execution_state.dart';
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/ionia/ionia_merchant.dart'; import 'package:cake_wallet/ionia/ionia_merchant.dart';
import 'package:cake_wallet/ionia/ionia_tip.dart'; import 'package:cake_wallet/ionia/ionia_tip.dart';
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';
@ -14,9 +13,6 @@ import 'package:cake_wallet/src/widgets/discount_badge.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
import 'package:cake_wallet/src/widgets/standart_list_row.dart'; import 'package:cake_wallet/src/widgets/standart_list_row.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/themes/dark_theme.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/typography.dart'; import 'package:cake_wallet/typography.dart';
import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/ionia/ionia_purchase_merch_view_model.dart'; import 'package:cake_wallet/view_model/ionia/ionia_purchase_merch_view_model.dart';
@ -24,48 +20,14 @@ import 'package:flutter/material.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:mobx/mobx.dart'; import 'package:mobx/mobx.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
class IoniaBuyGiftCardDetailPage extends StatelessWidget { class IoniaBuyGiftCardDetailPage extends BasePage {
IoniaBuyGiftCardDetailPage(this.ioniaPurchaseViewModel); IoniaBuyGiftCardDetailPage(this.ioniaPurchaseViewModel);
final IoniaMerchPurchaseViewModel ioniaPurchaseViewModel; final IoniaMerchPurchaseViewModel ioniaPurchaseViewModel;
ThemeBase get currentTheme => getIt.get<SettingsStore>().currentTheme; @override
Color get backgroundLightColor => Colors.white;
Color get backgroundDarkColor => PaletteDark.backgroundColor;
void onClose(BuildContext context) => Navigator.of(context).pop();
Widget leading(BuildContext context) {
if (ModalRoute.of(context).isFirst) {
return null;
}
final _backButton = Icon(
Icons.arrow_back_ios,
color: Theme.of(context).primaryTextTheme.title.color,
size: 16,
);
return Padding(
padding: const EdgeInsets.only(left: 10.0),
child: SizedBox(
height: 37,
width: 37,
child: ButtonTheme(
minWidth: double.minPositive,
child: FlatButton(
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
padding: EdgeInsets.all(0),
onPressed: () => onClose(context),
child: _backButton),
),
),
);
}
Widget middle(BuildContext context) { Widget middle(BuildContext context) {
return Text( return Text(
ioniaPurchaseViewModel.ioniaMerchant.legalName, ioniaPurchaseViewModel.ioniaMerchant.legalName,
@ -74,10 +36,13 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget {
} }
@override @override
Widget build(BuildContext context) { Widget trailing(BuildContext context)
final merchant = ioniaPurchaseViewModel.ioniaMerchant; => ioniaPurchaseViewModel.ioniaMerchant.minimumDiscount > 0
final _backgroundColor = currentTheme.type == ThemeType.dark ? backgroundDarkColor : backgroundLightColor; ? DiscountBadge(percentage: ioniaPurchaseViewModel.ioniaMerchant.minimumDiscount)
: null;
@override
Widget body(BuildContext context) {
reaction((_) => ioniaPurchaseViewModel.invoiceCreationState, (ExecutionState state) { reaction((_) => ioniaPurchaseViewModel.invoiceCreationState, (ExecutionState state) {
if (state is FailureState) { if (state is FailureState) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
@ -120,25 +85,12 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget {
} }
}); });
return Scaffold( return ScrollableWithBottomSection(
backgroundColor: _backgroundColor,
body: ScrollableWithBottomSection(
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
content: Observer(builder: (_) { content: Observer(builder: (_) {
final tipAmount = ioniaPurchaseViewModel.tipAmount; final tipAmount = ioniaPurchaseViewModel.tipAmount;
return Column( return Column(
children: [ children: [
SizedBox(height: 60),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
leading(context),
middle(context),
DiscountBadge(
percentage: merchant.minimumDiscount,
)
],
),
SizedBox(height: 36), SizedBox(height: 36),
Container( Container(
padding: EdgeInsets.symmetric(vertical: 24), padding: EdgeInsets.symmetric(vertical: 24),
@ -234,7 +186,7 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 24.0), padding: const EdgeInsets.symmetric(horizontal: 24.0),
child: TextIconButton( child: TextIconButton(
label: S.of(context).how_to_use_card, label: S.of(context).how_to_use_card,
onTap: () => _showHowToUseCard(context, merchant), onTap: () => _showHowToUseCard(context, ioniaPurchaseViewModel.ioniaMerchant),
), ),
), ),
], ],
@ -266,7 +218,6 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget {
SizedBox(height: 16) SizedBox(height: 16)
], ],
), ),
),
); );
} }

View file

@ -90,7 +90,7 @@ class IoniaManageCardsPage extends BasePage {
@override @override
Widget middle(BuildContext context) { Widget middle(BuildContext context) {
return Text( return Text(
S.of(context).manage_cards, S.of(context).gift_cards,
style: textLargeSemiBold( style: textLargeSemiBold(
color: Theme.of(context).accentTextTheme.display3.backgroundColor, color: Theme.of(context).accentTextTheme.display3.backgroundColor,
), ),

View file

@ -543,7 +543,7 @@
"sign_up": "Anmelden", "sign_up": "Anmelden",
"forgot_password": "Passwort vergessen", "forgot_password": "Passwort vergessen",
"reset_password": "Passwort zurücksetzen", "reset_password": "Passwort zurücksetzen",
"manage_cards": "Karten verwalten", "gift_cards": "Geschenkkarten",
"setup_your_debit_card": "Richten Sie Ihre Debitkarte ein", "setup_your_debit_card": "Richten Sie Ihre Debitkarte ein",
"no_id_required": "Keine ID erforderlich. Upgraden und überall ausgeben", "no_id_required": "Keine ID erforderlich. Upgraden und überall ausgeben",
"how_to_use_card": "Wie man diese Karte benutzt", "how_to_use_card": "Wie man diese Karte benutzt",

View file

@ -543,7 +543,7 @@
"sign_up": "Sign Up", "sign_up": "Sign Up",
"forgot_password": "Forgot Password", "forgot_password": "Forgot Password",
"reset_password": "Reset Password", "reset_password": "Reset Password",
"manage_cards": "Manage Cards", "gift_cards": "Gift Cards",
"setup_your_debit_card": "Set up your debit card", "setup_your_debit_card": "Set up your debit card",
"no_id_required": "No ID required. Top up and spend anywhere", "no_id_required": "No ID required. Top up and spend anywhere",
"how_to_use_card": "How to use this card", "how_to_use_card": "How to use this card",

View file

@ -543,7 +543,7 @@
"sign_up": "Registrarse", "sign_up": "Registrarse",
"forgot_password": "Olvidé mi contraseña", "forgot_password": "Olvidé mi contraseña",
"reset_password": "Restablecer contraseña", "reset_password": "Restablecer contraseña",
"manage_cards": "Administrar tarjetas", "gift_cards": "Tarjetas de regalo",
"setup_your_debit_card": "Configura tu tarjeta de débito", "setup_your_debit_card": "Configura tu tarjeta de débito",
"no_id_required": "No se requiere identificación. Recargue y gaste en cualquier lugar", "no_id_required": "No se requiere identificación. Recargue y gaste en cualquier lugar",
"how_to_use_card": "Cómo usar esta tarjeta", "how_to_use_card": "Cómo usar esta tarjeta",

View file

@ -541,7 +541,7 @@
"sign_up": "S'inscrire", "sign_up": "S'inscrire",
"forgot_password": "Mot de passe oublié", "forgot_password": "Mot de passe oublié",
"reset_password": "Réinitialiser le mot de passe", "reset_password": "Réinitialiser le mot de passe",
"manage_cards": "Gérer les cartes", "manage_cards": "Cartes cadeaux",
"setup_your_debit_card": "Configurer votre carte de débit", "setup_your_debit_card": "Configurer votre carte de débit",
"no_id_required": "Aucune pièce d'identité requise. Rechargez et dépensez n'importe où", "no_id_required": "Aucune pièce d'identité requise. Rechargez et dépensez n'importe où",
"how_to_use_card": "Comment utiliser cette carte", "how_to_use_card": "Comment utiliser cette carte",

View file

@ -543,7 +543,7 @@
"sign_up": "साइन अप करें", "sign_up": "साइन अप करें",
"forgot_password": "पासवर्ड भूल गए", "forgot_password": "पासवर्ड भूल गए",
"reset_password": "पासवर्ड रीसेट करें", "reset_password": "पासवर्ड रीसेट करें",
"manage_cards": "कार्ड मैनेज करें", "gift_cards": "उपहार कार्ड",
"setup_your_debit_card": "अपना डेबिट कार्ड सेट करें", "setup_your_debit_card": "अपना डेबिट कार्ड सेट करें",
"no_id_required": "कोई आईडी आवश्यक नहीं है। टॉप अप करें और कहीं भी खर्च करें", "no_id_required": "कोई आईडी आवश्यक नहीं है। टॉप अप करें और कहीं भी खर्च करें",
"how_to_use_card": "इस कार्ड का उपयोग कैसे करें", "how_to_use_card": "इस कार्ड का उपयोग कैसे करें",

View file

@ -543,7 +543,7 @@
"sign_up": "Prijavite se", "sign_up": "Prijavite se",
"forgot_password": "Zaboravljena lozinka", "forgot_password": "Zaboravljena lozinka",
"reset_password": "Poništi lozinku", "reset_password": "Poništi lozinku",
"manage_cards": "Upravljanje karticama", "gift_cards": "Ajándékkártya",
"setup_your_debit_card": "Postavite svoju debitnu karticu", "setup_your_debit_card": "Postavite svoju debitnu karticu",
"no_id_required": "Nije potreban ID. Nadopunite i potrošite bilo gdje", "no_id_required": "Nije potreban ID. Nadopunite i potrošite bilo gdje",
"how_to_use_card": "Kako koristiti ovu karticu", "how_to_use_card": "Kako koristiti ovu karticu",

View file

@ -543,7 +543,7 @@
"sign_up": "Registrati", "sign_up": "Registrati",
"forgot_password": "Password dimenticata", "forgot_password": "Password dimenticata",
"reset_password": "Reimposta password", "reset_password": "Reimposta password",
"manage_cards": "Gestisci carte", "gift_cards": "Carte regalo",
"setup_your_debit_card": "Configura la tua carta di debito", "setup_your_debit_card": "Configura la tua carta di debito",
"no_id_required": "Nessun ID richiesto. Ricarica e spendi ovunque", "no_id_required": "Nessun ID richiesto. Ricarica e spendi ovunque",
"how_to_use_card": "Come usare questa carta", "how_to_use_card": "Come usare questa carta",

View file

@ -543,7 +543,7 @@
"sign_up": "サインアップ", "sign_up": "サインアップ",
"forgot_password": "パスワードを忘れた", "forgot_password": "パスワードを忘れた",
"reset_password": "パスワードのリセット", "reset_password": "パスワードのリセット",
"manage_cards": "カードの管理", "gift_cards": "ギフトカード",
"setup_your_debit_card": "デビットカードを設定してください", "setup_your_debit_card": "デビットカードを設定してください",
"no_id_required": "IDは必要ありません。どこにでも補充して使用できます", "no_id_required": "IDは必要ありません。どこにでも補充して使用できます",
"how_to_use_card": "このカードの使用方法", "how_to_use_card": "このカードの使用方法",

View file

@ -543,7 +543,7 @@
"sign_up": "가입", "sign_up": "가입",
"forgot_password": "비밀번호 찾기", "forgot_password": "비밀번호 찾기",
"reset_password": "비밀번호 재설정", "reset_password": "비밀번호 재설정",
"manage_cards": "카드 관리", "gift_cards": "기프트 카드",
"setup_your_debit_card": "직불카드 설정", "setup_your_debit_card": "직불카드 설정",
"no_id_required": "신분증이 필요하지 않습니다. 충전하고 어디에서나 사용하세요", "no_id_required": "신분증이 필요하지 않습니다. 충전하고 어디에서나 사용하세요",
"how_to_use_card": "이 카드를 사용하는 방법", "how_to_use_card": "이 카드를 사용하는 방법",

View file

@ -543,7 +543,7 @@
"sign_up": "Aanmelden", "sign_up": "Aanmelden",
"forgot_password": "Wachtwoord vergeten", "forgot_password": "Wachtwoord vergeten",
"reset_password": "Wachtwoord resetten", "reset_password": "Wachtwoord resetten",
"manage_cards": "Kaarten beheren", "gift_cards": "Cadeaubonnen",
"setup_your_debit_card": "Stel uw debetkaart in", "setup_your_debit_card": "Stel uw debetkaart in",
"no_id_required": "Geen ID vereist. Opwaarderen en overal uitgeven", "no_id_required": "Geen ID vereist. Opwaarderen en overal uitgeven",
"how_to_use_card": "Hoe deze kaart te gebruiken", "how_to_use_card": "Hoe deze kaart te gebruiken",

View file

@ -546,7 +546,7 @@
"sign_up": "Zarejestruj się", "sign_up": "Zarejestruj się",
"forgot_password": "Zapomniałem hasła", "forgot_password": "Zapomniałem hasła",
"reset_password": "Zresetuj hasło", "reset_password": "Zresetuj hasło",
"manage_cards": "Zarządzaj kartami", "gift_cards": "Karty podarunkowe",
"setup_your_debit_card": "Skonfiguruj swoją kartę debetową", "setup_your_debit_card": "Skonfiguruj swoją kartę debetową",
"no_id_required": "Nie wymagamy ID. Doładuj i wydawaj gdziekolwiek", "no_id_required": "Nie wymagamy ID. Doładuj i wydawaj gdziekolwiek",
"how_to_use_card": "Jak korzystać z tej karty", "how_to_use_card": "Jak korzystać z tej karty",

View file

@ -543,7 +543,7 @@
"create_account": "Registar-se", "create_account": "Registar-se",
"forgot_password": "Esqueci a senha", "forgot_password": "Esqueci a senha",
"reset_password": "Redefinir senha", "reset_password": "Redefinir senha",
"manage_cards": "Gerenciar Cartões", "gift_cards": "Cartões de presente",
"setup_your_debit_card": "Configure seu cartão de débito", "setup_your_debit_card": "Configure seu cartão de débito",
"no_id_required": "Não é necessário ID. Recarregue e gaste em qualquer lugar", "no_id_required": "Não é necessário ID. Recarregue e gaste em qualquer lugar",
"how_to_use_card": "Como usar este cartão", "how_to_use_card": "Como usar este cartão",

View file

@ -543,7 +543,7 @@
"sign_up": "Зарегистрироваться", "sign_up": "Зарегистрироваться",
"forgot_password": "Забыли пароль", "forgot_password": "Забыли пароль",
"reset_password": "Сбросить пароль", "reset_password": "Сбросить пароль",
"manage_cards": "Управление картами", "gift_cards": "Подарочные карты",
"setup_your_debit_card": "Настройте свою дебетовую карту", "setup_your_debit_card": "Настройте свою дебетовую карту",
"no_id_required": "Идентификатор не требуется. Пополняйте и тратьте где угодно", "no_id_required": "Идентификатор не требуется. Пополняйте и тратьте где угодно",
"how_to_use_card": "Как использовать эту карту", "how_to_use_card": "Как использовать эту карту",

View file

@ -542,7 +542,7 @@
"sign_up": "Зареєструватися", "sign_up": "Зареєструватися",
"forgot_password": "Забули пароль", "forgot_password": "Забули пароль",
"reset_password": "Скинути пароль", "reset_password": "Скинути пароль",
"manage_cards": "Керувати картками", "gift_cards": "Подарункові карти",
"setup_your_debit_card": "Налаштуйте свою дебетову картку", "setup_your_debit_card": "Налаштуйте свою дебетову картку",
"no_id_required": "Ідентифікатор не потрібен. Поповнюйте та витрачайте будь-де", "no_id_required": "Ідентифікатор не потрібен. Поповнюйте та витрачайте будь-де",
"how_to_use_card": "Як використовувати цю картку", "how_to_use_card": "Як використовувати цю картку",

View file

@ -541,7 +541,7 @@
"sign_up": "注册", "sign_up": "注册",
"forgot_password": "忘记密码", "forgot_password": "忘记密码",
"reset_password": "重置密码", "reset_password": "重置密码",
"manage_cards": "管理卡片", "gift_cards": "礼品卡",
"setup_your_debit_card": "设置你的借记卡", "setup_your_debit_card": "设置你的借记卡",
"no_id_required": "不需要身份证。充值并在任何地方消费", "no_id_required": "不需要身份证。充值并在任何地方消费",
"how_to_use_card": "如何使用这张卡", "how_to_use_card": "如何使用这张卡",