From 722efa2f89c02b69d39c6382ab854c329ab57a2c Mon Sep 17 00:00:00 2001 From: Oleksandr Sobol Date: Thu, 7 May 2020 20:10:04 +0300 Subject: [PATCH] CWA-210 | applied new design to send page; created sending alert and confirm sending alert --- assets/images/2.0x/qr_code_icon.png | Bin 956 -> 1142 bytes assets/images/3.0x/qr_code_icon.png | Bin 1149 -> 1256 bytes assets/images/birthday_cake.png | Bin 0 -> 3979 bytes assets/images/qr_code_icon.png | Bin 665 -> 638 bytes lib/src/screens/send/send_page.dart | 578 ++++++++---------- .../send/widgets/confirm_sending_alert.dart | 100 +++ .../screens/send/widgets/sending_alert.dart | 105 ++++ lib/src/widgets/address_text_field.dart | 29 +- lib/src/widgets/base_alert_dialog.dart | 2 +- lib/src/widgets/seed_widget.dart | 1 - lib/src/widgets/top_panel.dart | 4 +- pubspec.lock | 21 + pubspec.yaml | 1 + 13 files changed, 504 insertions(+), 337 deletions(-) create mode 100644 assets/images/birthday_cake.png create mode 100644 lib/src/screens/send/widgets/confirm_sending_alert.dart create mode 100644 lib/src/screens/send/widgets/sending_alert.dart diff --git a/assets/images/2.0x/qr_code_icon.png b/assets/images/2.0x/qr_code_icon.png index c8b121d10e317df8b4c99df6ff3ef08ff52ed1b5..192c45fcbdda0ec5a9fed85da4b67ff74aa8c375 100644 GIT binary patch delta 1121 zcmV-n1fKi62lfb%B!3BTNLh0L02UPx#1ZP1_ zK>z@;j|==^1poj93rR#lRCoc!S4~nAK@@)7Ge$R-;|UBW0IZUqazQu&;RZ>S8YmYq z2voTuZ21c;ECd(836K*I78XA)h$k@KU@Uhb)9v>rnJ}5Z1b>RsuWFK>?tcAVzyA>g zR6czhavwda2(5=Skwq~OM2=EwdTDmNN-5abyUb(nLDD&`!$j3^-J(4^UYC{K^Q zQ_?z@M#O7U$|>prFrP?e?j5Fcu9VknxVY&W#sMa*_CgiE^(4B6);rV#4W)KWDM|Qe zMv;XEa>N&6t$#yh+GoBvGd4;802}*Pp2jhB%)orzAFS`5=OjxS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y)B0p zpgkzD7;SCce-e$iMEOmzXE?01gk%L(WIqU4DY|~Qtf6>0Q`ycynI|me!*W1^U}W_e zzxUIinsP;{;MbcQX+FUh+L*L(A2p!M!8UzS8SPj7!|+#5ajrDQ`fPP=dC3odKM_#s z6=rLjFbGF8!!ui>)o@WK|NiExv66$-^q#v4;hI5Di%4Cqe69V0dVxztp!NHH-3#e% zPmamlh}P8F6_WgNfs7;58jG|{uI|a(L|bSvK8?nhMu)T}3;jUSoONELJbqf9R}s%Za;e zacVX(C_0s#kR*SbpIlwKKUHNb%uarDl~Y@sGu|P;v|KD>fyYI;VNDxTHzsGwDI(dT zEv?(G8H%o!u|FwE$v@9_q@5hP1Hsxn)}Agzl#mNe%nzs zD;sN40}b=Ds~7^J5j*;-;QMF_9Mu^8gXn}7r*(l&>AD0qb!U=dPY@q@C8vJfj}tN#XLZ}J4KU46qWs0lDx1d5^dH>?eT0ZgMRDcQ z+x_J!FgB_tASw5+Y~U4 yL$O-T-$25W^Iz-?;4|R#=M+!`<^Q93pQqUNg2}n%Xz))N0CX-Jpexj`{q--Xck`YA literal 0 HcmV?d00001 diff --git a/assets/images/qr_code_icon.png b/assets/images/qr_code_icon.png index ad1b3631e859cff4f692a92ce45f46daf314ac54..2bc7d508c0f6b15cab8c686ceff21b8897390781 100644 GIT binary patch delta 613 zcmV-r0-F7q1^xt(B!3BTNLh0L01FcU01FcV0GgZ_00001b5ch_0Itp)=>Px#1ZP1_ zK>z@;j|==^1poj76G=otRCoc6Q$bQwK@jck8IYYhLT&&qEOeE40`UYU3kzKllzoyd z#)6H7xJf*L;RN|vSfDGoK|BF*Ls9T&+SmUxzkXafRlnv>_kZ;3*ROl{@Z`MXM2?iG zL20Q@58gg|MYT2h`fCPzJDr(mftZ0ua9pq0;Bav1*N9HyFj|C`A zLa@fj5gF_g=k`9HUi8vs`(I=3Cx5{pggLf`uTn6#6sWA4smPYm{d97^L_kA`_oDEU zW4yFGuvrNPKz~xF3F9To`6jrSKv`t7xLE4a#h%q;1evn?80Qb?9R$pfrGx)viNUr{ zbE2!!=}+@F%^u1mQ%*=npMPvc?_XAIRF`1$2jwi?`g%q;H_hPv%<4wa;KT0r(C$?l zwATuI&rGQ z;M~~SxFg4lpF6FBfBV?sakY{#s3ohh;vp5w5LDgP=OE z&|+Mm1764P-#k6T>Ff|K##@<`>@i68Zd5sGa1B~h7}7A=cxLi>am*_!Fqu9fcU;$oe=6OIThD(Jqo5d>VZ`*pBx@I)#hzFLtb*C&Fdc% z$9b^o|JrZAvxn^@j1KirF=5&smaW~+0xgs%fh!+E@_&2&%UL3vTUPUfRy1RiJ4rZ4 zOi_GfXyAO9cXQ@Zd$@FSUME|;cZHQ=Z S.current.send_title; @override - bool get isModalBackButton => true; + Color get backgroundColor => PaletteDark.menuList; @override bool get resizeToAvoidBottomPadding => false; @@ -44,7 +49,6 @@ class SendForm extends StatefulWidget { class SendFormState extends State { final _addressController = TextEditingController(); - final _paymentIdController = TextEditingController(); final _cryptoAmountController = TextEditingController(); final _fiatAmountController = TextEditingController(); @@ -75,14 +79,11 @@ class SendFormState extends State { await showDialog( context: context, builder: (BuildContext context) { - return AlertDialog( - title: Text(S.of(context).openalias_alert_title), - content: Text(S.of(context).openalias_alert_content(sendStore.recordName)), - actions: [ - FlatButton( - child: Text(S.of(context).ok), - onPressed: () => Navigator.of(context).pop()) - ], + return AlertWithOneAction( + alertTitle: S.of(context).openalias_alert_title, + alertContent: S.of(context).openalias_alert_content(sendStore.recordName), + buttonText: S.of(context).ok, + buttonAction: () => Navigator.of(context).pop() ); }); } @@ -99,89 +100,16 @@ class SendFormState extends State { _setEffects(context); - return ScrollableWithBottomSection( - contentPadding: EdgeInsets.all(0), + return Container( + color: PaletteDark.historyPanel, + child: ScrollableWithBottomSection( + contentPadding: EdgeInsets.only(bottom: 24), content: Column( - children: [ - Container( - padding: EdgeInsets.only(left: 38, right: 30), - decoration: BoxDecoration( - color: Theme.of(context).backgroundColor, - boxShadow: [ - BoxShadow( - color: Palette.shadowGrey, - blurRadius: 10, - offset: Offset(0, 12), - ) - ], - border: Border( - top: BorderSide( - width: 1, - color: Theme.of(context) - .accentTextTheme - .subtitle - .backgroundColor))), - child: SizedBox( - height: 56, - width: double.infinity, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Observer(builder: (_) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text(S.of(context).send_your_wallet, - style: TextStyle( - fontSize: 12, color: Palette.lightViolet)), - Text(walletStore.name, - style: TextStyle( - fontSize: 18, - color: Theme.of(context) - .accentTextTheme - .overline - .color, - height: 1.25)), - ]); - }), - Observer(builder: (context) { - final savedDisplayMode = settingsStore.balanceDisplayMode; - final availableBalance = - savedDisplayMode == BalanceDisplayMode.hiddenBalance - ? '---' - : balanceStore.unlockedBalance; - - return Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text(S.of(context).xmr_available_balance, - style: TextStyle( - fontSize: 12, - color: Theme.of(context) - .accentTextTheme - .overline - .backgroundColor, - )), - Text(availableBalance, - style: TextStyle( - fontSize: 22, - color: Theme.of(context) - .accentTextTheme - .overline - .color, - height: 1.1)), - ]); - }) - ], - ), - ), - ), - Form( - key: _formKey, - child: Container( - padding: - EdgeInsets.only(left: 38, right: 33, top: 10, bottom: 30), + children: [ + TopPanel( + color: PaletteDark.menuList, + widget: Form( + key: _formKey, child: Column(children: [ AddressTextField( controller: _addressController, @@ -190,19 +118,16 @@ class SendFormState extends State { onURIScanned: (uri) { var address = ''; var amount = ''; - var paymentId = ''; if (uri != null) { address = uri.path; amount = uri.queryParameters['tx_amount']; - paymentId = uri.queryParameters['tx_payment_id']; } else { address = uri.toString(); } _addressController.text = address; _cryptoAmountController.text = amount; - _paymentIdController.text = paymentId; }, options: [ AddressTextFieldOption.qrCode, @@ -214,102 +139,103 @@ class SendFormState extends State { return sendStore.errorMessage; }, ), - Padding( - padding: const EdgeInsets.only(top: 20), - child: TextFormField( - style: TextStyle( - fontSize: 14.0, - color: Theme.of(context) - .accentTextTheme - .overline - .backgroundColor), - controller: _paymentIdController, - decoration: InputDecoration( - hintStyle: TextStyle( - fontSize: 14.0, - color: Theme.of(context).hintColor), - hintText: S.of(context).send_payment_id, - focusedBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: Palette.cakeGreen, width: 2.0)), - enabledBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context).focusColor, - width: 1.0))), - validator: (value) { - sendStore.validatePaymentID(value); - return sendStore.errorMessage; - }), + Observer( + builder: (_) { + return Padding( + padding: const EdgeInsets.only(top: 20), + child: TextFormField( + style: TextStyle( + fontSize: 16.0, + color: Colors.white + ), + controller: _cryptoAmountController, + keyboardType: TextInputType.numberWithOptions( + signed: false, decimal: true), + inputFormatters: [ + BlacklistingTextInputFormatter( + RegExp('[\\-|\\ |\\,]')) + ], + decoration: InputDecoration( + prefixIcon: Padding( + padding: EdgeInsets.only(top: 12), + child: Text('XMR:', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + color: Colors.white, + )), + ), + suffixIcon: Padding( + padding: EdgeInsets.only( + bottom: 5 + ), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: MediaQuery.of(context).size.width/2, + alignment: Alignment.centerLeft, + child: Text( + ' / ' + balanceStore.unlockedBalance, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 16, + color: PaletteDark.walletCardText + ) + ), + ), + Container( + height: 32, + width: 32, + margin: EdgeInsets.only(left: 12, bottom: 7, top: 4), + decoration: BoxDecoration( + color: PaletteDark.walletCardSubAddressField, + borderRadius: BorderRadius.all(Radius.circular(6)) + ), + child: InkWell( + onTap: () => sendStore.setSendAll(), + child: Center( + child: Text(S.of(context).all, + style: TextStyle( + fontSize: 9, + fontWeight: FontWeight.bold, + color: PaletteDark.walletCardText + ) + ), + ), + ), + ) + ], + ), + ), + hintStyle: TextStyle( + fontSize: 16.0, + color: Colors.white), + hintText: '0.0000', + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: PaletteDark.walletCardSubAddressField, + width: 1.0)), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: PaletteDark.walletCardSubAddressField, + width: 1.0))), + validator: (value) { + sendStore.validateXMR( + value, balanceStore.unlockedBalance); + return sendStore.errorMessage; + }), + ); + } ), Padding( padding: const EdgeInsets.only(top: 20), child: TextFormField( style: TextStyle( - fontSize: 18.0, - color: Theme.of(context) - .accentTextTheme - .overline - .color), - controller: _cryptoAmountController, - keyboardType: TextInputType.numberWithOptions( - signed: false, decimal: true), - inputFormatters: [ - BlacklistingTextInputFormatter( - RegExp('[\\-|\\ |\\,]')) - ], - decoration: InputDecoration( - prefixIcon: Padding( - padding: EdgeInsets.only(top: 12), - child: Text('XMR:', - style: TextStyle( - fontSize: 18, - color: Theme.of(context) - .accentTextTheme - .overline - .color, - )), - ), - suffixIcon: Container( - width: 1, - padding: EdgeInsets.only(top: 0), - child: Center( - child: InkWell( - onTap: () => sendStore.setSendAll(), - child: Text(S.of(context).all, - style: TextStyle( - fontSize: 10, - color: Theme.of(context) - .accentTextTheme - .overline - .decorationColor))), - ), - ), - hintStyle: TextStyle( - fontSize: 18.0, - color: Theme.of(context).hintColor), - hintText: '0.0000', - focusedBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: Palette.cakeGreen, width: 2.0)), - enabledBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context).focusColor, - width: 1.0))), - validator: (value) { - sendStore.validateXMR( - value, balanceStore.unlockedBalance); - return sendStore.errorMessage; - }), - ), - Padding( - padding: const EdgeInsets.only(top: 20), - child: TextFormField( - style: TextStyle( - fontSize: 18.0, - color: Theme.of(context) - .accentTextTheme - .overline - .color), + fontSize: 16.0, + color: Colors.white), controller: _fiatAmountController, keyboardType: TextInputType.numberWithOptions( signed: false, decimal: true), @@ -323,123 +249,147 @@ class SendFormState extends State { child: Text( '${settingsStore.fiatCurrency.toString()}:', style: TextStyle( - fontSize: 18, - color: Theme.of(context) - .accentTextTheme - .overline - .color, + fontSize: 16, + fontWeight: FontWeight.bold, + color: Colors.white, )), ), hintStyle: TextStyle( - fontSize: 18.0, - color: Theme.of(context).hintColor), + fontSize: 16.0, + color: PaletteDark.walletCardText), hintText: '0.00', focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: Palette.cakeGreen, width: 2.0)), + color: PaletteDark.walletCardSubAddressField, + width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: Theme.of(context).focusColor, + color: PaletteDark.walletCardSubAddressField, width: 1.0)))), ), - Padding( - padding: const EdgeInsets.only(top: 12.0, bottom: 10), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text(S.of(context).send_estimated_fee, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w500, - color: Theme.of(context) - .accentTextTheme - .overline - .backgroundColor, - )), - Text( - '${calculateEstimatedFee(priority: settingsStore.transactionPriority)} XMR', - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme - .overline - .backgroundColor, - )) - ], - ), - ), - SizedBox( - width: double.infinity, - child: Text( - S.of(context).send_priority( - settingsStore.transactionPriority.toString()), - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w500, - color: Theme.of(context) - .primaryTextTheme - .subtitle - .color, - height: 1.3)), - ), ]), ), + ), + Padding( + padding: EdgeInsets.only( + top: 32, + left: 24, + bottom: 24 + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + 'Templates', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + color: PaletteDark.walletCardText + ), + ) + ], + ), + ), + Container( + height: 40, + width: double.infinity, + padding: EdgeInsets.only(left: 24), + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: 1, + itemBuilder: (context, index) { + + if (index == 0) { + return GestureDetector( + onTap: () {}, + child: Container( + padding: EdgeInsets.only(right: 10), + child: DottedBorder( + borderType: BorderType.RRect, + dashPattern: [8, 4], + color: PaletteDark.menuList, + strokeWidth: 2, + radius: Radius.circular(20), + child: Container( + height: 40, + width: 75, + padding: EdgeInsets.only(left: 10, right: 10), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20)), + color: Colors.transparent, + ), + child: Text( + 'New', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + color: PaletteDark.walletCardText + ), + ), + ) + ), + ), + ); + } + + return Container(); + } + ), ) ], ), + bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24), bottomSection: Observer(builder: (_) { return LoadingPrimaryButton( onPressed: syncStore.status is SyncedSyncStatus ? () async { - // Hack. Don't ask me. - FocusScope.of(context).requestFocus(FocusNode()); + // Hack. Don't ask me. + FocusScope.of(context).requestFocus(FocusNode()); - if (_formKey.currentState.validate()) { - await showDialog( - context: context, - builder: (dialogContext) { - return AlertDialog( - title: Text( - S.of(context).send_creating_transaction), - content: Text(S.of(context).confirm_sending), - actions: [ - FlatButton( - child: Text(S.of(context).send), - onPressed: () async { - await Navigator.of(dialogContext) - .popAndPushNamed(Routes.auth, - arguments: (bool - isAuthenticatedSuccessfully, - AuthPageState auth) { - if (!isAuthenticatedSuccessfully) { - return; - } + if (_formKey.currentState.validate()) { + await showDialog( + context: context, + builder: (dialogContext) { + return AlertWithTwoActions( + alertTitle: S.of(context).send_creating_transaction, + alertContent: S.of(context).confirm_sending, + leftButtonText: S.of(context).send, + rightButtonText: S.of(context).cancel, + actionLeftButton: () async { + await Navigator.of(dialogContext) + .popAndPushNamed(Routes.auth, + arguments: (bool + isAuthenticatedSuccessfully, + AuthPageState auth) { + if (!isAuthenticatedSuccessfully) { + return; + } - Navigator.of(auth.context).pop(); + Navigator.of(auth.context).pop(); - sendStore.createTransaction( - address: _addressController.text, - paymentId: - _paymentIdController.text); - }); - }), - FlatButton( - child: Text(S.of(context).cancel), - onPressed: () => - Navigator.of(context).pop()) - ], - ); - }); - } - } - : null, + sendStore.createTransaction( + address: _addressController.text, + paymentId: ''); + }); + }, + actionRightButton: () => + Navigator.of(context).pop() + ); + }); + } + } + : null, text: S.of(context).send, - color: Theme.of(context).accentTextTheme.button.backgroundColor, - textColor: Theme.of(context).primaryTextTheme.button.color, + color: Colors.blue, + textColor: Colors.white, isLoading: sendStore.state is CreatingTransaction || - sendStore.state is TransactionCommiting); - })); + sendStore.state is TransactionCommiting, + isDisabled: !(syncStore.status is SyncedSyncStatus), + ); + }), + ), + ); } void _setEffects(BuildContext context) { @@ -483,14 +433,11 @@ class SendFormState extends State { showDialog( context: context, builder: (BuildContext context) { - return AlertDialog( - title: Text(S.of(context).error), - content: Text(state.error), - actions: [ - FlatButton( - child: Text(S.of(context).ok), - onPressed: () => Navigator.of(context).pop()) - ], + return AlertWithOneAction( + alertTitle: S.of(context).error, + alertContent: state.error, + buttonText: S.of(context).ok, + buttonAction: () => Navigator.of(context).pop() ); }); }); @@ -501,23 +448,25 @@ class SendFormState extends State { showDialog( context: context, builder: (BuildContext context) { - return AlertDialog( - title: Text(S.of(context).confirm_sending), - content: Text(S.of(context).commit_transaction_amount_fee( - sendStore.pendingTransaction.amount, - sendStore.pendingTransaction.fee)), - actions: [ - FlatButton( - child: Text(S.of(context).ok), - onPressed: () { - Navigator.of(context).pop(); - sendStore.commitTransaction(); - }), - FlatButton( - child: Text(S.of(context).cancel), - onPressed: () => Navigator.of(context).pop(), - ) - ], + return ConfirmSendingAlert( + alertTitle: S.of(context).confirm_sending, + amount: 'Amount:', + amountValue: sendStore.pendingTransaction.amount, + fee: 'Fee:', + feeValue: sendStore.pendingTransaction.fee, + leftButtonText: S.of(context).ok, + rightButtonText: S.of(context).cancel, + actionLeftButton: () { + Navigator.of(context).pop(); + sendStore.commitTransaction(); + showDialog( + context: context, + builder: (BuildContext context) { + return SendingAlert(sendStore: sendStore); + } + ); + }, + actionRightButton: () => Navigator.of(context).pop() ); }); }); @@ -525,23 +474,8 @@ class SendFormState extends State { if (state is TransactionCommitted) { WidgetsBinding.instance.addPostFrameCallback((_) { - showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - title: Text(S.of(context).sending), - content: Text(S.of(context).transaction_sent), - actions: [ - FlatButton( - child: Text(S.of(context).ok), - onPressed: () { - _addressController.text = ''; - _cryptoAmountController.text = ''; - Navigator.of(context)..pop()..pop(); - }) - ], - ); - }); + _addressController.text = ''; + _cryptoAmountController.text = ''; }); } }); diff --git a/lib/src/screens/send/widgets/confirm_sending_alert.dart b/lib/src/screens/send/widgets/confirm_sending_alert.dart new file mode 100644 index 000000000..373180863 --- /dev/null +++ b/lib/src/screens/send/widgets/confirm_sending_alert.dart @@ -0,0 +1,100 @@ +import 'package:flutter/material.dart'; +import 'package:cake_wallet/src/widgets/base_alert_dialog.dart'; + +class ConfirmSendingAlert extends BaseAlertDialog { + ConfirmSendingAlert({ + @required this.alertTitle, + @required this.amount, + @required this.amountValue, + @required this.fee, + @required this.feeValue, + @required this.leftButtonText, + @required this.rightButtonText, + @required this.actionLeftButton, + @required this.actionRightButton, + this.alertBarrierDismissible = true + }); + + final String alertTitle; + final String amount; + final String amountValue; + final String fee; + final String feeValue; + final String leftButtonText; + final String rightButtonText; + final VoidCallback actionLeftButton; + final VoidCallback actionRightButton; + final bool alertBarrierDismissible; + + @override + String get titleText => alertTitle; + + @override + String get leftActionButtonText => leftButtonText; + @override + String get rightActionButtonText => rightButtonText; + @override + VoidCallback get actionLeft => actionLeftButton; + @override + VoidCallback get actionRight => actionRightButton; + @override + bool get barrierDismissible => alertBarrierDismissible; + + @override + Widget content(BuildContext context) { + return Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + amount, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Colors.white, + decoration: TextDecoration.none, + ), + ), + Text( + amountValue, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Colors.white, + decoration: TextDecoration.none, + ), + ) + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + fee, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Colors.white, + decoration: TextDecoration.none, + ), + ), + Text( + feeValue, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Colors.white, + decoration: TextDecoration.none, + ), + ) + ], + ) + ], + ); + } +} \ No newline at end of file diff --git a/lib/src/screens/send/widgets/sending_alert.dart b/lib/src/screens/send/widgets/sending_alert.dart new file mode 100644 index 000000000..da23e4df0 --- /dev/null +++ b/lib/src/screens/send/widgets/sending_alert.dart @@ -0,0 +1,105 @@ +import 'dart:ui'; +import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/src/stores/send/sending_state.dart'; +import 'package:flutter/material.dart'; +import 'package:cake_wallet/src/widgets/primary_button.dart'; +import 'package:cake_wallet/src/stores/send/send_store.dart'; +import 'package:cake_wallet/generated/i18n.dart'; +import 'package:flutter_mobx/flutter_mobx.dart'; + +class SendingAlert extends StatefulWidget { + SendingAlert({@required this.sendStore}); + + final SendStore sendStore; + + @override + SendingAlertState createState() => SendingAlertState(sendStore); +} + +class SendingAlertState extends State { + SendingAlertState(this.sendStore); + + final SendStore sendStore; + + @override + Widget build(BuildContext context) { + return Observer( + builder: (_) { + final state = sendStore.state; + + if (state is TransactionCommitted) { + return Stack( + children: [ + Container( + color: PaletteDark.historyPanel, + child: Center( + child: Image.asset( + 'assets/images/birthday_cake.png'), + ), + ), + Center( + child: Padding( + padding: EdgeInsets.only(top: 220, left: 24, right: 24), + child: Text( + 'Your Monero was successfully sent', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 22, + fontWeight: FontWeight.bold, + color: Colors.white, + decoration: TextDecoration.none, + ), + ), + ), + ), + Positioned( + left: 24, + right: 24, + bottom: 24, + child: PrimaryButton( + onPressed: () => Navigator.of(context).pop(), + text: 'Got it', + color: Colors.blue, + textColor: Colors.white + ) + ) + ], + ); + } + + return Stack( + children: [ + Container( + color: PaletteDark.historyPanel, + child: Center( + child: Image.asset( + 'assets/images/birthday_cake.png'), + ), + ), + BackdropFilter( + filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0), + child: Container( + decoration: BoxDecoration(color: PaletteDark.historyPanel.withOpacity(0.25)), + child: Center( + child: Padding( + padding: EdgeInsets.only(top: 220), + child: Text( + 'Sending...', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 22, + fontWeight: FontWeight.bold, + color: Colors.white, + decoration: TextDecoration.none, + ), + ), + ), + ), + ), + ) + ], + ); + } + ); + } +} \ No newline at end of file diff --git a/lib/src/widgets/address_text_field.dart b/lib/src/widgets/address_text_field.dart index a13132e55..d8525a4e9 100644 --- a/lib/src/widgets/address_text_field.dart +++ b/lib/src/widgets/address_text_field.dart @@ -40,6 +40,10 @@ class AddressTextField extends StatelessWidget { enabled: isActive, controller: controller, focusNode: focusNode, + style: TextStyle( + fontSize: 16, + color: Colors.white + ), decoration: InputDecoration( suffixIcon: SizedBox( width: prefixIconWidth * options.length + @@ -58,9 +62,9 @@ class AddressTextField extends StatelessWidget { child: Container( padding: EdgeInsets.all(8), decoration: BoxDecoration( - color: Palette.wildDarkBlueWithOpacity, + color: PaletteDark.walletCardSubAddressField, borderRadius: - BorderRadius.all(Radius.circular(8))), + BorderRadius.all(Radius.circular(6))), child: Image.asset('assets/images/qr_code_icon.png')), )) ], @@ -76,11 +80,11 @@ class AddressTextField extends StatelessWidget { child: Container( padding: EdgeInsets.all(8), decoration: BoxDecoration( - color: Palette.wildDarkBlueWithOpacity, + color: PaletteDark.walletCardSubAddressField, borderRadius: - BorderRadius.all(Radius.circular(8))), + BorderRadius.all(Radius.circular(6))), child: Image.asset( - 'assets/images/address_book_icon.png')), + 'assets/images/open_book.png')), )) ], if (this @@ -95,9 +99,9 @@ class AddressTextField extends StatelessWidget { child: Container( padding: EdgeInsets.all(8), decoration: BoxDecoration( - color: Palette.wildDarkBlueWithOpacity, + color: PaletteDark.walletCardSubAddressField, borderRadius: - BorderRadius.all(Radius.circular(8))), + BorderRadius.all(Radius.circular(6))), child: Image.asset( 'assets/images/receive_icon_raw.png')), )) @@ -105,13 +109,18 @@ class AddressTextField extends StatelessWidget { ], ), ), - hintStyle: TextStyle(color: Theme.of(context).hintColor), + hintStyle: TextStyle( + fontSize: 16, + color: PaletteDark.walletCardText + ), hintText: placeholder ?? S.current.widgets_address, focusedBorder: UnderlineInputBorder( - borderSide: BorderSide(color: Palette.cakeGreen, width: 2.0)), + borderSide: BorderSide( + color: PaletteDark.walletCardSubAddressField, + width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: - BorderSide(color: Theme.of(context).focusColor, width: 1.0)), + BorderSide(color: PaletteDark.walletCardSubAddressField, width: 1.0)), ), validator: validator, ); diff --git a/lib/src/widgets/base_alert_dialog.dart b/lib/src/widgets/base_alert_dialog.dart index d85ae21fc..082cd418b 100644 --- a/lib/src/widgets/base_alert_dialog.dart +++ b/lib/src/widgets/base_alert_dialog.dart @@ -138,7 +138,7 @@ class BaseAlertDialog extends StatelessWidget { Container( width: 300, height: 77, - padding: EdgeInsets.all(24), + padding: EdgeInsets.only(left: 24, right: 24), decoration: BoxDecoration( borderRadius: BorderRadius.only( topLeft: Radius.circular(24), diff --git a/lib/src/widgets/seed_widget.dart b/lib/src/widgets/seed_widget.dart index ec33d7ede..64298da6d 100644 --- a/lib/src/widgets/seed_widget.dart +++ b/lib/src/widgets/seed_widget.dart @@ -238,7 +238,6 @@ class SeedWidgetState extends State { fit: FlexFit.tight, flex: 1, child: TopPanel( - height: null, color: PaletteDark.menuList, widget: SingleChildScrollView( child: Column( diff --git a/lib/src/widgets/top_panel.dart b/lib/src/widgets/top_panel.dart index c175b26c9..dc8b5c1d5 100644 --- a/lib/src/widgets/top_panel.dart +++ b/lib/src/widgets/top_panel.dart @@ -1,9 +1,8 @@ import 'package:flutter/material.dart'; class TopPanel extends StatelessWidget { - TopPanel({@required this.height, @required this.color, @required this.widget}); + TopPanel({@required this.color, @required this.widget}); - final double height; final Color color; final Widget widget; @@ -11,7 +10,6 @@ class TopPanel extends StatelessWidget { Widget build(BuildContext context) { return Container( width: double.infinity, - height: height ?? double.infinity, padding: EdgeInsets.all(24), decoration: BoxDecoration( borderRadius: BorderRadius.only( diff --git a/pubspec.lock b/pubspec.lock index ee0d1d59f..02600cd1b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -232,6 +232,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.0.7" + dotted_border: + dependency: "direct main" + description: + name: dotted_border + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" encrypt: dependency: "direct main" description: @@ -525,6 +532,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.6.4" + path_drawing: + dependency: transitive + description: + name: path_drawing + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4" path_provider: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 561f9e935..b0818a6fc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -49,6 +49,7 @@ dependencies: package_info: ^0.4.0+13 devicelocale: ^0.2.1 auto_size_text: ^2.1.0 + dotted_border: ^1.0.5 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons.