* UI fixes for ionia.

* Changed tips for ionia.

* Fixes for IoniaBuyGiftCardDetailPage screen. Renamed 'Manage Cards' to 'Gift Cards'. Hide discount badge label for 0 discount.
This commit is contained in:
mkyq 2022-07-20 18:33:34 +01:00 committed by GitHub
parent 32f5a79079
commit 1d4a9f93cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 27 additions and 76 deletions

View file

@ -1,7 +1,6 @@
import 'dart:ui';
import 'package:cake_wallet/anypay/any_pay_payment_committed_info.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_tip.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/scollable_with_bottom_section.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/utils/show_pop_up.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:flutter_mobx/flutter_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);
final IoniaMerchPurchaseViewModel ioniaPurchaseViewModel;
ThemeBase get currentTheme => getIt.get<SettingsStore>().currentTheme;
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),
),
),
);
}
@override
Widget middle(BuildContext context) {
return Text(
ioniaPurchaseViewModel.ioniaMerchant.legalName,
@ -74,10 +36,13 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget {
}
@override
Widget build(BuildContext context) {
final merchant = ioniaPurchaseViewModel.ioniaMerchant;
final _backgroundColor = currentTheme.type == ThemeType.dark ? backgroundDarkColor : backgroundLightColor;
Widget trailing(BuildContext context)
=> ioniaPurchaseViewModel.ioniaMerchant.minimumDiscount > 0
? DiscountBadge(percentage: ioniaPurchaseViewModel.ioniaMerchant.minimumDiscount)
: null;
@override
Widget body(BuildContext context) {
reaction((_) => ioniaPurchaseViewModel.invoiceCreationState, (ExecutionState state) {
if (state is FailureState) {
WidgetsBinding.instance.addPostFrameCallback((_) {
@ -120,25 +85,12 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget {
}
});
return Scaffold(
backgroundColor: _backgroundColor,
body: ScrollableWithBottomSection(
return ScrollableWithBottomSection(
contentPadding: EdgeInsets.zero,
content: Observer(builder: (_) {
final tipAmount = ioniaPurchaseViewModel.tipAmount;
return Column(
children: [
SizedBox(height: 60),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
leading(context),
middle(context),
DiscountBadge(
percentage: merchant.minimumDiscount,
)
],
),
SizedBox(height: 36),
Container(
padding: EdgeInsets.symmetric(vertical: 24),
@ -234,7 +186,7 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 24.0),
child: TextIconButton(
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)
],
),
),
);
}

View file

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

View file

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

View file

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

View file

@ -543,7 +543,7 @@
"sign_up": "Registrarse",
"forgot_password": "Olvidé mi 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",
"no_id_required": "No se requiere identificación. Recargue y gaste en cualquier lugar",
"how_to_use_card": "Cómo usar esta tarjeta",

View file

@ -541,7 +541,7 @@
"sign_up": "S'inscrire",
"forgot_password": "Mot de passe oublié",
"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",
"no_id_required": "Aucune pièce d'identité requise. Rechargez et dépensez n'importe où",
"how_to_use_card": "Comment utiliser cette carte",

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -543,7 +543,7 @@
"create_account": "Registar-se",
"forgot_password": "Esqueci a 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",
"no_id_required": "Não é necessário ID. Recarregue e gaste em qualquer lugar",
"how_to_use_card": "Como usar este cartão",

View file

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

View file

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

View file

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