From 6639d25264b54bed0144823ba42735f6e448a31c Mon Sep 17 00:00:00 2001 From: M Date: Mon, 18 Jan 2021 22:52:12 +0200 Subject: [PATCH] CAKE-220. CAKE-241. CAKE-242. --- assets/images/settings_menu.png | Bin 594 -> 1186 bytes lib/monero/monero_wallet.dart | 6 +++--- lib/palette.dart | 1 + lib/src/screens/backup/backup_page.dart | 2 +- .../backup/edit_backup_password_page.dart | 2 +- lib/src/screens/dashboard/wallet_menu.dart | 16 ++++++++++++++++ lib/src/widgets/trail_button.dart | 6 +++--- .../settings/settings_view_model.dart | 13 ------------- 8 files changed, 25 insertions(+), 21 deletions(-) diff --git a/assets/images/settings_menu.png b/assets/images/settings_menu.png index 35ef51aeeaf2f65fad0e3b86f667fa81feea3293..eef0ce0d22f4ffca59d748a51c17f116c05ff51a 100644 GIT binary patch literal 1186 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRp!3HFQtmCqP6id3JuOkD)#(wTUiL5}rLb6AY zF9SoB8UsT^3j@P1pisjL28L1t28LG&3=CE?7#PG0=Ijcz0ZO!_MtG+A`Z8z%*&Gb4 zj6w{|Ko%nqGB8RpfJ_6j7`zyz;p`wr4X7F>28Q-b1{SEAC?E|29zYDz1EHB0Fd|G` zzywzaUOBIa;$cls-GxgeDwB3M4o_O!)aEzc{OLN-oy&;H8xt45xuH-b|a?)d-s#nGiFqU`rJFPczU9?QTp+vN17sZ30Y4qaP{9z0rm z=B%pry-$6GcMZ;;wJ%@Xkai^fnB|>gF1>}PZ~p$X`P629SH7JZ{Cfe9N;+9_-*cR`t%3Az#**x6}^&n zL;lr)cxeZ2InQsQ=Dpg2NsR21KlE@hnq3nP>F@KKWVm=2!_v;JJWn^RS|webQ}4uP z{p;Bb@4OeL&k`rAe4AVT>iLmcCKkE$qTb|Hd)%Css+P=~p4gn+Ef@KP_u951{v9(6 z{_lOu81jlEzy0KbMyb~uGYrn0GP!c-zJkR?;fZX{morPlQp)E2j^w=b{~!B_`rNgD roBn*2OkTswvp%4Cx~tym1c`I(4_Cd|qs6M)0m^xvu6{1-oD!M<&a#$? delta 552 zcmV+@0@wYb3DN|RB$4nGe*gh|b5a*u4=mm&tViM;Ct9=0mlT>atFR%@jGtLX*{J=jz zcdQ*|R=Zdh2DVC7Q=^%l-rgRlJ!fcUsZ)AL!1s`v-&19O+icyge?>cSYOaTzH5{h9 ze`xKXil3%`wHIJuZh9K-j1&%hxl+pwRVQybuFw&{JOWkZvR^h^Jpz0)i_w-Ytrd`u z&Eek`vmDHffxC6ajmE{%4>X!fQZ!1)oy+fyPL4suY>+y*d89rl76uAM%@PGpi|aeN zFN^d}L}CHE4xQWWf26Gj_vAiF&A`lh;2IgKqgYYl*bGH0K<7N>gzw4!(0zl>L~1T= zwhXALZq5)P>&dj%Jnh1Kz8c%Zsix|KOyjR7)0;gz04(Xp5X?t5D`Psu)4C&h{}Mo{ zUOTkwk6i$_`5&TO+!)gmvkpgo259*#KoCd1w1WQk)h>?ZfBhZwZPcdi4*~GBqc|OQ zUsPQarhKhQ?aulc1EX%}FEJ=?*ceoJdPMfZ_I)gqxw-G82v{X<bw_5;hR^JWDnhGZ;oK_N{YkX&z5WpyJZ> q&zs3708yl{9>V_V;*vGZ70&}y==%EJ3{w&S0000 with Store { balance = MoneroBalance( fullBalance: monero_wallet.getFullBalance(accountIndex: 0), unlockedBalance: monero_wallet.getFullBalance(accountIndex: 0)); + _lastAutosaveTimestamp = 0; + _isSavingAfterSync = false; + _isSavingAfterNewTransaction = false; _onAccountChangeReaction = reaction((_) => account, (Account account) { balance = MoneroBalance( fullBalance: monero_wallet.getFullBalance(accountIndex: account.id), @@ -47,9 +50,6 @@ abstract class MoneroWalletBase extends WalletBase with Store { subaddressList.update(accountIndex: account.id); subaddress = subaddressList.subaddresses.first; address = subaddress.address; - _lastAutosaveTimestamp = 0; - _isSavingAfterSync = false; - _isSavingAfterNewTransaction = false; }); } diff --git a/lib/palette.dart b/lib/palette.dart index 5f18ac62f..336f7b7f9 100644 --- a/lib/palette.dart +++ b/lib/palette.dart @@ -43,6 +43,7 @@ class Palette { static const Color brightOrange = Color.fromRGBO(255, 102, 0, 1.0); static const Color dullGray = Color.fromRGBO(98, 98, 98, 1.0); static const Color protectiveBlue = Color.fromRGBO(33, 148, 255, 1.0); + static const Color darkBlue = Color.fromRGBO(109, 128, 178, 1.0); } class PaletteDark { diff --git a/lib/src/screens/backup/backup_page.dart b/lib/src/screens/backup/backup_page.dart index 3d88acc50..158815205 100644 --- a/lib/src/screens/backup/backup_page.dart +++ b/lib/src/screens/backup/backup_page.dart @@ -24,7 +24,7 @@ class BackupPage extends BasePage { @override Widget trailing(BuildContext context) => TrailButton( - caption: S.of(context).edit, + caption: 'Change password', onPressed: () => Navigator.of(context).pushNamed(Routes.editBackupPassword)); diff --git a/lib/src/screens/backup/edit_backup_password_page.dart b/lib/src/screens/backup/edit_backup_password_page.dart index d0f4c8fd1..2eeb9b149 100644 --- a/lib/src/screens/backup/edit_backup_password_page.dart +++ b/lib/src/screens/backup/edit_backup_password_page.dart @@ -37,7 +37,7 @@ class EditBackupPasswordPage extends BasePage { autocorrect: false, keyboardType: TextInputType.visiblePassword, controller: textEditingController, - style: TextStyle(fontSize: 26, color: Colors.black)))), + style: TextStyle(fontSize: 26, color: Theme.of(context).primaryTextTheme.title.color)))), Positioned( child: Observer( builder: (_) => PrimaryButton( diff --git a/lib/src/screens/dashboard/wallet_menu.dart b/lib/src/screens/dashboard/wallet_menu.dart index 273cdd9bf..936a7e629 100644 --- a/lib/src/screens/dashboard/wallet_menu.dart +++ b/lib/src/screens/dashboard/wallet_menu.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/screens/dashboard/wallet_menu_item.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:flutter/material.dart'; @@ -36,6 +37,12 @@ class WalletMenu { title: S.current.address_book_menu, image: Image.asset('assets/images/open_book_menu.png', height: 16, width: 16)), + WalletMenuItem( + title: 'Backup', + image: Image.asset('assets/images/restore_wallet.png', + height: 16, + width: 16, + color: Palette.darkBlue)), WalletMenuItem( title: S.current.settings_title, image: Image.asset('assets/images/settings_menu.png', @@ -81,6 +88,15 @@ class WalletMenu { Navigator.of(context).pushNamed(Routes.addressBook); break; case 6: + Navigator.of(context).pushNamed(Routes.auth, + arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) { + if (isAuthenticatedSuccessfully) { + auth.close(); + Navigator.of(auth.context).pushNamed(Routes.backup); + } + }); + break; + case 7: Navigator.of(context).pushNamed(Routes.settings); break; default: diff --git a/lib/src/widgets/trail_button.dart b/lib/src/widgets/trail_button.dart index 73d8d39b2..dcd0703d2 100644 --- a/lib/src/widgets/trail_button.dart +++ b/lib/src/widgets/trail_button.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:cake_wallet/palette.dart'; class TrailButton extends StatelessWidget { TrailButton({@required this.caption, @required this.onPressed}); @@ -17,9 +18,8 @@ class TrailButton extends StatelessWidget { child: Text( caption, style: TextStyle( - color: - Theme.of(context).accentTextTheme.bodyText2.color, - fontWeight: FontWeight.w500, + color: Palette.blueCraiola, + fontWeight: FontWeight.w600, fontSize: 14), ), onPressed: onPressed), diff --git a/lib/view_model/settings/settings_view_model.dart b/lib/view_model/settings/settings_view_model.dart index eb2623f75..9da79b19b 100644 --- a/lib/view_model/settings/settings_view_model.dart +++ b/lib/view_model/settings/settings_view_model.dart @@ -122,19 +122,6 @@ abstract class SettingsViewModelBase with Store { onItemSelected: (ThemeBase theme) => _settingsStore.currentTheme = theme) ], - [ - RegularListItem( - title: 'Backup', - handler: (BuildContext context) { - Navigator.of(context).pushNamed(Routes.auth, arguments: - (bool isAuthenticatedSuccessfully, AuthPageState auth) { - auth.close(); - if (isAuthenticatedSuccessfully) { - Navigator.of(context).pushNamed(Routes.backup); - } - }); - }), - ], [ LinkListItem( title: 'Email',