From 4859e2e26d4ba078a5ecb67141544f0436bd25cf Mon Sep 17 00:00:00 2001 From: OmarHatem28 Date: Mon, 4 Jul 2022 19:02:59 +0200 Subject: [PATCH] Adjust pay with button to pay with current wallet currency --- .../phone_number_product_page.dart | 49 ++++++++++--------- res/values/strings_en.arb | 3 +- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/lib/src/screens/cake_phone/cake_phone_products/phone_number_product_page.dart b/lib/src/screens/cake_phone/cake_phone_products/phone_number_product_page.dart index 18fa386ab..48e6d082e 100644 --- a/lib/src/screens/cake_phone/cake_phone_products/phone_number_product_page.dart +++ b/lib/src/screens/cake_phone/cake_phone_products/phone_number_product_page.dart @@ -1,5 +1,7 @@ +import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; import 'package:cake_wallet/src/widgets/picker.dart'; +import 'package:cake_wallet/store/app_store.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/view_model/cake_phone/phone_plan_view_model.dart'; import 'package:country_pickers/country.dart'; @@ -329,8 +331,8 @@ class PhoneNumberProductBodyState extends State { contentWidget: Column( mainAxisSize: MainAxisSize.min, children: [ - receiptRow(S.of(context).amount, phonePlanViewModel.totalPrice), - receiptRow(S.of(context).cake_pay_balance, 100), + cakePayReceiptRow(S.of(context).amount, phonePlanViewModel.totalPrice), + cakePayReceiptRow(S.of(context).cake_pay_balance, 100), ], ), isDividerExists: true, @@ -342,14 +344,14 @@ class PhoneNumberProductBodyState extends State { actionLeftButton: () => Navigator.of(dialogContext).pop()); }); }, - text: S.of(context).pay_with_cake_phone, + text: "${S.of(context).pay_with} ${S.of(context).cake_pay_balance}", color: Theme.of(context).accentTextTheme.caption.backgroundColor, textColor: Theme.of(context).primaryTextTheme.title.color, ), const SizedBox(height: 8), PrimaryButton( onPressed: () {}, - text: S.of(context).pay_with_xmr, + text: "${S.of(context).pay_with} ${getIt.get().wallet.currency.toString()}", color: Theme.of(context).accentTextTheme.body2.color, textColor: Colors.white, ), @@ -408,29 +410,30 @@ class PhoneNumberProductBodyState extends State { ); } - Widget receiptRow(String title, double amount) { + Widget cakePayReceiptRow(String title, double amount) { return Padding( padding: const EdgeInsets.only(top: 24), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "$title:", - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - color: Theme.of(context).accentTextTheme.subhead.color, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "$title:", + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Theme.of(context).accentTextTheme.subhead.color, + ), ), - ), - Text( - "\$${amount.roundToDouble() == amount ? amount.round() : amount}", - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.w700, - color: Theme.of(context).primaryTextTheme.title.color, + Text( + "\$${amount.roundToDouble() == amount ? amount.round() : amount}", + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w700, + color: Theme.of(context).primaryTextTheme.title.color, + ), ), - ), - ], - ),); + ], + ), + ); } } diff --git a/res/values/strings_en.arb b/res/values/strings_en.arb index 05334bca1..57be3961a 100644 --- a/res/values/strings_en.arb +++ b/res/values/strings_en.arb @@ -559,8 +559,7 @@ "phone_number_product_description": "SMS messages are forwarded to your email address. Includes 20 free SMS messages for each month of service with the option to pay for more.", "initial_service_term": "Initial Service Term", "phone_number_promotion_text": "You can add more time later. Save big on longer terms!", - "pay_with_cake_phone": "Pay with CakePhone Balance", - "pay_with_xmr": "Pay with XMR", + "pay_with": "Pay with", "due_today": "Due today:", "free_sms_email_forward": "Free SMS Email Forwards", "month": "month",