CAKE-19 | created page view store, alert background, alert close button, cake scrollbar; applied new design to monero_account_edit_or_create_page, monero_account_list_page, address_edit_or_create_page; added scrollOffsetFromTop to monero_account_list_view_model; added string resources to arb files and colors to palette

Oleksandr Sobol committed Jul 28, 2020 at 19:03 UTC 153673d4183b8fcd4251eb14906d6032a6223932
40 files changed +446 -303
assets/images/2.0x/close.png
Binary files /dev/null and b/assets/images/2.0x/close.png differ
assets/images/2.0x/copy_address.png
Binary files /dev/null and b/assets/images/2.0x/copy_address.png differ
assets/images/2.0x/share.png
Binary files a/assets/images/2.0x/share.png and b/assets/images/2.0x/share.png differ
assets/images/3.0x/close.png
Binary files /dev/null and b/assets/images/3.0x/close.png differ
assets/images/3.0x/copy_address.png
Binary files /dev/null and b/assets/images/3.0x/copy_address.png differ
assets/images/3.0x/share.png
Binary files a/assets/images/3.0x/share.png and b/assets/images/3.0x/share.png differ
assets/images/close.png
Binary files /dev/null and b/assets/images/close.png differ
assets/images/share.png
Binary files a/assets/images/share.png and b/assets/images/share.png differ
lib/di.dart
+4 -1
@@ -57,6 +57,7 @@ import 'package:cake_wallet/store/dashboard/trades_store.dart';
57 import 'package:cake_wallet/store/dashboard/trade_filter_store.dart';
58 import 'package:cake_wallet/store/dashboard/transaction_filter_store.dart';
59 import 'package:cake_wallet/store/dashboard/fiat_convertation_store.dart';
60 +import 'package:cake_wallet/store/dashboard/page_view_store.dart';
61
62 final getIt = GetIt.instance;
63
@@ -110,6 +111,7 @@ Future setup(
111 TradeFilterStore(wallet: getIt.get<AppStore>().wallet));
112 getIt.registerSingleton<TransactionFilterStore>(TransactionFilterStore());
113 getIt.registerSingleton<FiatConvertationStore>(FiatConvertationStore());
114 + getIt.registerSingleton<PageViewStore>(PageViewStore());
115
116 getIt.registerFactory<KeyService>(
117 () => KeyService(getIt.get<FlutterSecureStorage>()));
@@ -153,7 +155,8 @@ Future setup(
155 appStore: getIt.get<AppStore>(),
156 tradesStore: getIt.get<TradesStore>(),
157 tradeFilterStore: getIt.get<TradeFilterStore>(),
156 - transactionFilterStore: getIt.get<TransactionFilterStore>()
158 + transactionFilterStore: getIt.get<TransactionFilterStore>(),
159 + pageViewStore: getIt.get<PageViewStore>()
160 ));
161
162 getIt.registerFactory<AuthService>(() => AuthService(
lib/generated/i18n.dart
+45
@@ -162,6 +162,7 @@ class S implements WidgetsLocalizations {
162 String get restore_wallet_restore_description => "Wallet restore description";
163 String get save => "Save";
164 String get saved_the_trade_id => "I've saved the trade ID";
165 + String get scan_qr_code => "Scan the QR code to get the address";
166 String get seed_choose => "Choose seed language";
167 String get seed_language_chinese => "Chinese";
168 String get seed_language_choose => "Please choose seed language:";
@@ -623,6 +624,8 @@ class $de extends S {
624 @override
625 String get xmr_available_balance => "XMR verfügbares Guthaben";
626 @override
627 + String get scan_qr_code => "Scannen Sie den QR-Code, um die Adresse zu erhalten";
628 + @override
629 String get trade_state_paid => "Bezahlt";
630 @override
631 String get node_new => "Neuer Knoten";
@@ -749,6 +752,8 @@ class $de extends S {
752 @override
753 String get error_text_fiat => "Der Wert des Betrags darf den verfügbaren Kontostand nicht überschreiten.\nDie Anzahl der Nachkommastellen muss kleiner oder gleich 2 sein";
754 @override
755 + String get addresses => "Adressen";
756 + @override
757 String get transactions_by_date => "Transaktionen nach Datum";
758 @override
759 String get restore_from_seed_placeholder => "Bitte geben Sie hier Ihren Code ein";
@@ -1243,6 +1248,8 @@ class $hi extends S {
1248 @override
1249 String get xmr_available_balance => "XMR उपलब्ध शेष राशि";
1250 @override
1251 + String get scan_qr_code => "पता प्राप्त करने के लिए QR कोड स्कैन करें";
1252 + @override
1253 String get trade_state_paid => "भुगतान किया है";
1254 @override
1255 String get node_new => "नया नोड";
@@ -1369,6 +1376,8 @@ class $hi extends S {
1376 @override
1377 String get error_text_fiat => "राशि का मूल्य उपलब्ध शेष राशि से अधिक नहीं हो सकता.\nअंश अंकों की संख्या कम या 2 के बराबर होनी चाहिए";
1378 @override
1379 + String get addresses => "पतों";
1380 + @override
1381 String get transactions_by_date => "तारीख से लेन-देन";
1382 @override
1383 String get restore_from_seed_placeholder => "कृपया अपना कोड वाक्यांश यहां दर्ज करें या पेस्ट करें";
@@ -1863,6 +1872,8 @@ class $ru extends S {
1872 @override
1873 String get xmr_available_balance => "Доступный XMR баланс";
1874 @override
1875 + String get scan_qr_code => "Отсканируйте QR-код для получения адреса";
1876 + @override
1877 String get trade_state_paid => "Оплаченная";
1878 @override
1879 String get node_new => "Новая нода";
@@ -1989,6 +2000,8 @@ class $ru extends S {
2000 @override
2001 String get error_text_fiat => "Значение суммы не может превышать доступный баланс.\nКоличество цифр после запятой должно быть меньше или равно 2";
2002 @override
2003 + String get addresses => "Адреса";
2004 + @override
2005 String get transactions_by_date => "Сортировать по дате";
2006 @override
2007 String get restore_from_seed_placeholder => "Введите или вставьте мнемоническую фразу вашего кошелька";
@@ -2483,6 +2496,8 @@ class $ko extends S {
2496 @override
2497 String get xmr_available_balance => "XMR 사용 가능한 잔액";
2498 @override
2499 + String get scan_qr_code => "QR 코드를 스캔하여 주소를 얻습니다.";
2500 + @override
2501 String get trade_state_paid => "유료";
2502 @override
2503 String get node_new => "새로운 노드";
@@ -2609,6 +2624,8 @@ class $ko extends S {
2624 @override
2625 String get error_text_fiat => "금액은 사용 가능한 잔액을 초과 할 수 없습니다.\n소수 자릿수는 2보다 작거나 같아야합니다";
2626 @override
2627 + String get addresses => "구애";
2628 + @override
2629 String get transactions_by_date => "날짜 별 거래";
2630 @override
2631 String get restore_from_seed_placeholder => "여기에 코드 문구를 입력하거나 붙여 넣으십시오.";
@@ -3103,6 +3120,8 @@ class $pt extends S {
3120 @override
3121 String get xmr_available_balance => "Saldo XMR disponível";
3122 @override
3123 + String get scan_qr_code => "Digitalize o código QR para obter o endereço";
3124 + @override
3125 String get trade_state_paid => "Paga";
3126 @override
3127 String get node_new => "Novo nó";
@@ -3229,6 +3248,8 @@ class $pt extends S {
3248 @override
3249 String get error_text_fiat => "O valor do valor não pode exceder o saldo disponível.\nO número de dígitos decimais deve ser menor ou igual a 2";
3250 @override
3251 + String get addresses => "Endereços";
3252 + @override
3253 String get transactions_by_date => "Transações por data";
3254 @override
3255 String get restore_from_seed_placeholder => "Digite ou cole sua frase de código aqui";
@@ -3723,6 +3744,8 @@ class $uk extends S {
3744 @override
3745 String get xmr_available_balance => "Доступний XMR баланс";
3746 @override
3747 + String get scan_qr_code => "Скануйте QR-код для одержання адреси";
3748 + @override
3749 String get trade_state_paid => "Оплачена";
3750 @override
3751 String get node_new => "Новий вузол";
@@ -3849,6 +3872,8 @@ class $uk extends S {
3872 @override
3873 String get error_text_fiat => "Значення суми не може перевищувати доступний баланс.\nКількість цифр після коми повинно бути меншим або дорівнювати 2";
3874 @override
3875 + String get addresses => "Адреси";
3876 + @override
3877 String get transactions_by_date => "Сортувати по даті";
3878 @override
3879 String get restore_from_seed_placeholder => "Введіть або вставте мнемонічну фразу вашого гаманця";
@@ -4343,6 +4368,8 @@ class $ja extends S {
4368 @override
4369 String get xmr_available_balance => "XMR利用可能残高";
4370 @override
4371 + String get scan_qr_code => "QRコードをスキャンして住所を取得します";
4372 + @override
4373 String get trade_state_paid => "有料";
4374 @override
4375 String get node_new => "新しいノード";
@@ -4469,6 +4496,8 @@ class $ja extends S {
4496 @override
4497 String get error_text_fiat => "金額は利用可能な残高を超えることはできません.\n小数桁の数は2以下でなければなりません";
4498 @override
4499 + String get addresses => "住所";
4500 + @override
4501 String get transactions_by_date => "日付ごとの取引";
4502 @override
4503 String get restore_from_seed_placeholder => "ここにコードフレーズを入力または貼り付けてください";
@@ -4967,6 +4996,8 @@ class $pl extends S {
4996 @override
4997 String get xmr_available_balance => "XMR Dostępne saldo";
4998 @override
4999 + String get scan_qr_code => "Zeskanuj kod QR, aby uzyskać adres";
5000 + @override
5001 String get trade_state_paid => "Płatny";
5002 @override
5003 String get node_new => "Nowy węzeł";
@@ -5093,6 +5124,8 @@ class $pl extends S {
5124 @override
5125 String get error_text_fiat => "Wartość kwoty nie może przekroczyć dostępnego salda.\nLiczba cyfr ułamkowych musi być mniejsza lub równa 2";
5126 @override
5127 + String get addresses => "Adresy";
5128 + @override
5129 String get transactions_by_date => "Transakcje według daty";
5130 @override
5131 String get restore_from_seed_placeholder => "Wpisz lub wklej tutaj swoją frazę kodową";
@@ -5587,6 +5620,8 @@ class $es extends S {
5620 @override
5621 String get xmr_available_balance => "XMR Available Balance";
5622 @override
5623 + String get scan_qr_code => "Escanee el código QR para obtener la dirección";
5624 + @override
5625 String get trade_state_paid => "Pagado";
5626 @override
5627 String get node_new => "Nuevo nodo";
@@ -5713,6 +5748,8 @@ class $es extends S {
5748 @override
5749 String get error_text_fiat => "El valor de la cantidad no puede exceder el saldo disponible.\nEl número de dígitos de fracción debe ser menor o igual a 2";
5750 @override
5751 + String get addresses => "Direcciones";
5752 + @override
5753 String get transactions_by_date => "Transacciones por fecha";
5754 @override
5755 String get restore_from_seed_placeholder => "Ingrese o pegue su frase de código aquí";
@@ -6207,6 +6244,8 @@ class $nl extends S {
6244 @override
6245 String get xmr_available_balance => "XMR Beschikbaar saldo";
6246 @override
6247 + String get scan_qr_code => "Scan de QR-code om het adres te krijgen";
6248 + @override
6249 String get trade_state_paid => "Betaald";
6250 @override
6251 String get node_new => "Nieuw knooppunt";
@@ -6333,6 +6372,8 @@ class $nl extends S {
6372 @override
6373 String get error_text_fiat => "Waarde van bedrag kan het beschikbare saldo niet overschrijden.\nHet aantal breukcijfers moet kleiner zijn dan of gelijk zijn aan 2";
6374 @override
6375 + String get addresses => "Adressen";
6376 + @override
6377 String get transactions_by_date => "Transacties op datum";
6378 @override
6379 String get restore_from_seed_placeholder => "Voer hier uw codefrase in of plak deze";
@@ -6827,6 +6868,8 @@ class $zh extends S {
6868 @override
6869 String get xmr_available_balance => "XMR 可用余额 ";
6870 @override
6871 + String get scan_qr_code => "掃描二維碼獲取地址";
6872 + @override
6873 String get trade_state_paid => "已付费";
6874 @override
6875 String get node_new => "新节点";
@@ -6953,6 +6996,8 @@ class $zh extends S {
6996 @override
6997 String get error_text_fiat => "金额不能超过可用余额.\n小数位数必须小于或等于2";
6998 @override
6999 + String get addresses => "地址";
7000 + @override
7001 String get transactions_by_date => "按日期交易";
7002 @override
7003 String get restore_from_seed_placeholder => "请在此处输入或粘贴您的代码短语";
lib/palette.dart
+6 -2
@@ -18,10 +18,9 @@ class Palette {
18 }
19
20 class PaletteDark {
21 - static const Color distantBlue = Color.fromRGBO(70, 85, 133, 1.0); // mainBackgroundColor
21 + //static const Color distantBlue = Color.fromRGBO(70, 85, 133, 1.0); // mainBackgroundColor
22 static const Color lightDistantBlue = Color.fromRGBO(81, 96, 147, 1.0); // borderCardColor
23 static const Color gray = Color.fromRGBO(140, 153, 201, 1.0); // walletCardText
24 - static const Color violetBlue = Color.fromRGBO(51, 63, 104, 1.0); // walletCardAddressField
24 static const Color moderateBlue = Color.fromRGBO(63, 77, 122, 1.0); // walletCardSubAddressField
25 static const Color darkNightBlue = Color.fromRGBO(33, 43, 73, 1.0); // historyPanel
26 static const Color pigeonBlue = Color.fromRGBO(91, 112, 146, 1.0); // historyPanelText
@@ -40,11 +39,16 @@ class PaletteDark {
39 static const Color orangeYellow = Color.fromRGBO(243, 166, 50, 1.0);
40 static const Color brightGreen = Color.fromRGBO(88, 243, 50, 1.0);
41 static const Color oceanBlue = Color.fromRGBO(27, 39, 71, 1.0);
42 + static const Color lightOceanBlue = Color.fromRGBO(32, 45, 80, 1.0);
43 static const Color lightNightBlue = Color.fromRGBO(39, 52, 89, 1.0);
44 static const Color wildBlue = Color.fromRGBO(165, 176, 205, 1.0);
45 static const Color lightBlueGrey = Color.fromRGBO(125, 141, 183, 1.0);
46 + static const Color wildBlueGrey = Color.fromRGBO(125, 137, 182, 1.0);
47 static const Color darkGrey = Color.fromRGBO(118, 131, 169, 1.0);
48 static const Color dividerColor = Color.fromRGBO(48, 59, 95, 1.0);
49 + static const Color violetBlue = Color.fromRGBO(59, 72, 119, 1.0);
50 + static const Color deepPurpleBlue = Color.fromRGBO(19, 29, 56, 1.0);
51 + static const Color distantBlue = Color.fromRGBO(72, 85, 131, 1.0);
52
53 // FIXME: Rename.
54 static const Color eee = Color.fromRGBO(236, 239, 245, 1.0);
lib/src/screens/base_page.dart
+5 -3
@@ -23,9 +23,9 @@ abstract class BasePage extends StatelessWidget {
23
24 Widget Function(BuildContext, Widget) get rootWrapper => null;
25
26 - final _backArrowImage = Image.asset('assets/images/back_arrow.png');
26 + final _backArrowImage = Image.asset('assets/images/back_arrow.png', color: Colors.white);
27 final _backArrowImageDarkTheme =
28 - Image.asset('assets/images/back_arrow_dark_theme.png');
28 + Image.asset('assets/images/back_arrow_dark_theme.png', color: Colors.white);
29 final _closeButtonImage = Image.asset('assets/images/close_button.png');
30 final _closeButtonImageDarkTheme =
31 Image.asset('assets/images/close_button_dark_theme.png');
@@ -71,7 +71,9 @@ abstract class BasePage extends StatelessWidget {
71 style: TextStyle(
72 fontSize: 18.0,
73 fontWeight: FontWeight.bold,
74 - color: Theme.of(context).primaryTextTheme.title.color),
74 + //color: Theme.of(context).primaryTextTheme.title.color,
75 + color: Colors.white,
76 + ),
77 );
78 }
79
lib/src/screens/dashboard/dashboard_page.dart
+4 -1
@@ -28,6 +28,9 @@ class DashboardPage extends BasePage {
28 @override
29 Color get backgroundDarkColor => PaletteDark.backgroundColor;
30
31 + @override
32 + bool get resizeToAvoidBottomPadding => false;
33 +
34 @override
35 Widget middle(BuildContext context) {
36 return SyncIndicator(dashboardViewModel: walletViewModel);
@@ -158,7 +161,7 @@ class DashboardPage extends BasePage {
161 pages.add(TransactionsPage(dashboardViewModel: walletViewModel));
162
163 controller.addListener(() {
161 - walletViewModel.currentPage = controller.page;
164 + walletViewModel.pageViewStore.setCurrentPage(controller.page);
165 });
166
167 reaction((_) => walletViewModel.currentPage, (double currentPage) {
lib/src/screens/monero_accounts/monero_account_edit_or_create_page.dart
+8 -1
@@ -8,6 +8,7 @@ import 'package:cake_wallet/view_model/monero_account_list/monero_account_edit_o
8 import 'package:cake_wallet/src/widgets/primary_button.dart';
9 import 'package:cake_wallet/src/screens/base_page.dart';
10 import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
11 +import 'package:cake_wallet/palette.dart';
12
13 class MoneroAccountEditOrCreatePage extends BasePage {
14 MoneroAccountEditOrCreatePage({@required this.moneroAccountCreationViewModel})
@@ -23,6 +24,12 @@ class MoneroAccountEditOrCreatePage extends BasePage {
24 @override
25 String get title => S.current.account;
26
27 + @override
28 + Color get backgroundLightColor => PaletteDark.backgroundColor;
29 +
30 + @override
31 + Color get backgroundDarkColor => PaletteDark.backgroundColor;
32 +
33 final GlobalKey<FormState> _formKey;
34 final TextEditingController _textController;
35
@@ -31,7 +38,6 @@ class MoneroAccountEditOrCreatePage extends BasePage {
38 Form(
39 key: _formKey,
40 child: Container(
34 - color: Theme.of(context).backgroundColor,
41 padding: EdgeInsets.all(24.0),
42 child: Column(
43 children: <Widget>[
@@ -39,6 +45,7 @@ class MoneroAccountEditOrCreatePage extends BasePage {
45 child: Center(
46 child: BaseTextFormField(
47 controller: _textController,
48 + textColor: Colors.white,
49 hintText: S.of(context).account,
50 validator: MoneroLabelValidator(),
51 ))),
lib/src/screens/monero_accounts/monero_account_list_page.dart
+132 -108
@@ -7,133 +7,157 @@ import 'package:cake_wallet/routes.dart';
7 import 'package:cake_wallet/generated/i18n.dart';
8 import 'package:cake_wallet/view_model/monero_account_list/monero_account_list_view_model.dart';
9 import 'package:cake_wallet/src/screens/monero_accounts/widgets/account_tile.dart';
10 +import 'package:cake_wallet/src/widgets/alert_background.dart';
11 +import 'package:cake_wallet/src/widgets/cake_scrollbar.dart';
12 +import 'package:cake_wallet/src/widgets/alert_close_button.dart';
13
11 -class MoneroAccountListPage extends StatefulWidget {
12 - MoneroAccountListPage({@required this.accountListViewModel});
14 +class MoneroAccountListPage extends StatelessWidget {
15 + MoneroAccountListPage({@required this.accountListViewModel}) {
16 + backgroundHeight = 194;
17 + thumbHeight = 72;
18 + isAlwaysShowScrollThumb = false;
19 + controller = ScrollController();
20
14 - final MoneroAccountListViewModel accountListViewModel;
15 -
16 - @override
17 - MoneroAccountListPageForm createState() =>
18 - MoneroAccountListPageForm(accountListViewModel);
19 -}
20 -
21 -class MoneroAccountListPageForm extends State<MoneroAccountListPage> {
22 - MoneroAccountListPageForm(this.accountListViewModel);
21 + controller.addListener(() {
22 + final scrollOffsetFromTop = controller.hasClients
23 + ? (controller.offset / controller.position.maxScrollExtent * (backgroundHeight - thumbHeight))
24 + : 0.0;
25 + accountListViewModel.setScrollOffsetFromTop(scrollOffsetFromTop);
26 + });
27 + }
28
29 final MoneroAccountListViewModel accountListViewModel;
30 + final closeIcon = Image.asset('assets/images/close.png');
31 +
32 + ScrollController controller;
33 + double backgroundHeight;
34 + double thumbHeight;
35 + bool isAlwaysShowScrollThumb;
36
37 @override
38 Widget build(BuildContext context) {
28 - return GestureDetector(
29 - onTap: () => Navigator.of(context).pop(),
30 - child: Container(
31 - color: Colors.transparent,
32 - child: BackdropFilter(
33 - filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0),
34 - child: Container(
35 - decoration: BoxDecoration(
36 - color: PaletteDark.darkNightBlue.withOpacity(0.75)),
37 - child: Center(
38 - child: Column(
39 - mainAxisSize: MainAxisSize.min,
40 - children: <Widget>[
41 - Container(
42 - padding: EdgeInsets.only(left: 24, right: 24),
43 - child: Text(
44 - S.of(context).choose_account,
45 - textAlign: TextAlign.center,
46 - style: TextStyle(
47 - fontSize: 18,
48 - fontWeight: FontWeight.bold,
49 - decoration: TextDecoration.none,
50 - color: Colors.white),
51 - ),
39 + return AlertBackground(
40 + child: Stack(
41 + alignment: Alignment.center,
42 + children: <Widget>[
43 + Column(
44 + mainAxisSize: MainAxisSize.min,
45 + children: <Widget>[
46 + Container(
47 + padding: EdgeInsets.only(left: 24, right: 24),
48 + child: Text(
49 + S.of(context).choose_account,
50 + textAlign: TextAlign.center,
51 + style: TextStyle(
52 + fontSize: 18,
53 + fontWeight: FontWeight.bold,
54 + decoration: TextDecoration.none,
55 + color: Colors.white
56 ),
53 - Padding(
54 - padding: EdgeInsets.only(left: 24, right: 24, top: 24),
55 - child: GestureDetector(
56 - onTap: () => null,
57 - child: ClipRRect(
58 - borderRadius: BorderRadius.all(Radius.circular(14)),
59 - child: Container(
60 - height: 296,
61 - color: Theme.of(context)
62 - .accentTextTheme
63 - .title
64 - .backgroundColor,
65 - child: Column(
66 - children: <Widget>[
67 - Expanded(child: Observer(builder: (_) {
68 - final accounts =
69 - widget.accountListViewModel.accounts;
57 + ),
58 + ),
59 + Padding(
60 + padding: EdgeInsets.only(left: 24, right: 24, top: 24),
61 + child: GestureDetector(
62 + onTap: () => null,
63 + child: ClipRRect(
64 + borderRadius: BorderRadius.all(Radius.circular(14)),
65 + child: Container(
66 + height: 296,
67 + color: PaletteDark.deepPurpleBlue,
68 + child: Column(
69 + children: <Widget>[
70 + Expanded(
71 + child: Observer(
72 + builder: (_) {
73 + final accounts = accountListViewModel.accounts;
74 + isAlwaysShowScrollThumb = accounts == null
75 + ? false
76 + : accounts.length > 3;
77
71 - return ListView.separated(
72 - separatorBuilder: (context, index) => Divider(
73 - color: Theme.of(context).dividerColor,
74 - height: 1),
75 - itemCount: accounts.length ?? 0,
76 - itemBuilder: (context, index) {
77 - final account = accounts[index];
78 + return Stack(
79 + alignment: Alignment.center,
80 + children: <Widget>[
81 + ListView.separated(
82 + controller: controller,
83 + separatorBuilder: (context, index) =>
84 + Container(
85 + height: 1,
86 + color: PaletteDark.dividerColor,
87 + ),
88 + itemCount: accounts.length ?? 0,
89 + itemBuilder: (context, index) {
90 + final account = accounts[index];
91
79 - return AccountTile(
80 - isCurrent: account.isSelected,
81 - accountName: account.label,
82 - onTap: () {
83 - if (account.isSelected) {
84 - return;
85 - }
92 + return AccountTile(
93 + isCurrent: account.isSelected,
94 + accountName: account.label,
95 + onTap: () {
96 + if (account.isSelected) {
97 + return;
98 + }
99
87 - widget.accountListViewModel
88 - .select(account);
89 - Navigator.of(context).pop();
90 - });
91 - },
92 - );
93 - })),
94 - GestureDetector(
95 - onTap: () async => await Navigator.of(context)
96 - .pushNamed(Routes.accountCreation),
97 - child: Container(
98 - height: 62,
99 - color: Colors.white,
100 - padding: EdgeInsets.only(left: 24, right: 24),
101 - child: Center(
102 - child: Row(
103 - mainAxisSize: MainAxisSize.min,
104 - children: <Widget>[
105 - Icon(
106 - Icons.add,
107 - color: PaletteDark.darkNightBlue,
100 + accountListViewModel
101 + .select(account);
102 + Navigator.of(context).pop();
103 + });
104 + },
105 ),
109 - Padding(
110 - padding: EdgeInsets.only(left: 5),
111 - child: Text(
112 - S.of(context).create_new_account,
113 - style: TextStyle(
114 - fontSize: 15,
115 - fontWeight: FontWeight.w600,
116 - color: PaletteDark.darkNightBlue,
117 - decoration: TextDecoration.none,
118 - ),
119 - ),
106 + isAlwaysShowScrollThumb
107 + ? CakeScrollbar(
108 + backgroundHeight: backgroundHeight,
109 + thumbHeight: thumbHeight,
110 + fromTop: accountListViewModel
111 + .scrollOffsetFromTop
112 )
113 + : Offstage(),
114 ],
122 - ),
123 - ),
124 - ),
115 + );
116 + }
117 )
126 - ],
118 ),
128 - ),
119 + GestureDetector(
120 + onTap: () async => await Navigator.of(context)
121 + .pushNamed(Routes.accountCreation),
122 + child: Container(
123 + height: 62,
124 + color: Colors.white,
125 + padding: EdgeInsets.only(left: 24, right: 24),
126 + child: Center(
127 + child: Row(
128 + mainAxisSize: MainAxisSize.min,
129 + children: <Widget>[
130 + Icon(
131 + Icons.add,
132 + color: PaletteDark.darkNightBlue,
133 + ),
134 + Padding(
135 + padding: EdgeInsets.only(left: 5),
136 + child: Text(
137 + S.of(context).create_new_account,
138 + style: TextStyle(
139 + fontSize: 15,
140 + fontWeight: FontWeight.w600,
141 + color: PaletteDark.darkNightBlue,
142 + decoration: TextDecoration.none,
143 + ),
144 + ),
145 + )
146 + ],
147 + ),
148 + ),
149 + ),
150 + )
151 + ],
152 ),
153 ),
131 - )
132 - ],
133 - ),
134 - ),
154 + ),
155 + ),
156 + )
157 + ],
158 ),
136 - ),
159 + AlertCloseButton(image: closeIcon)
160 + ],
161 ),
162 );
163 }
lib/src/screens/monero_accounts/widgets/account_tile.dart
+3 -2
@@ -1,4 +1,5 @@
1 import 'package:flutter/material.dart';
2 +import 'package:cake_wallet/palette.dart';
3
4 class AccountTile extends StatelessWidget {
5 AccountTile({
@@ -13,8 +14,8 @@ class AccountTile extends StatelessWidget {
14
15 @override
16 Widget build(BuildContext context) {
16 - final color = isCurrent ? Theme.of(context).accentTextTheme.subtitle.decorationColor : Colors.transparent;
17 - final textColor = isCurrent ? Colors.blue : Theme.of(context).primaryTextTheme.title.color;
17 + final color = isCurrent ? PaletteDark.lightOceanBlue : Colors.transparent;
18 + final textColor = isCurrent ? Colors.blue : Colors.white;
19
20 return GestureDetector(
21 onTap: onTap,
lib/src/screens/receive/receive_page.dart
+43 -159
@@ -1,199 +1,72 @@
1 import 'package:flutter/material.dart';
2 import 'package:flutter/cupertino.dart';
3 -import 'package:flutter/services.dart';
3 import 'package:flutter_mobx/flutter_mobx.dart';
4 import 'package:esys_flutter_share/esys_flutter_share.dart';
5 import 'package:cake_wallet/routes.dart';
6 import 'package:cake_wallet/generated/i18n.dart';
7 import 'package:cake_wallet/di.dart';
8 import 'package:cake_wallet/src/screens/base_page.dart';
10 -import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
9 import 'package:cake_wallet/src/screens/monero_accounts/monero_account_list_page.dart';
10 import 'package:cake_wallet/src/screens/receive/widgets/header_tile.dart';
13 -import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
14 -import 'package:cake_wallet/core/amount_validator.dart';
11 import 'package:cake_wallet/src/screens/receive/widgets/address_cell.dart';
12 import 'package:cake_wallet/view_model/wallet_address_list/wallet_account_list_header.dart';
13 import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_header.dart';
14 import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_item.dart';
15 import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
16 +import 'package:cake_wallet/src/screens/receive/widgets/qr_widget.dart';
17 +import 'package:cake_wallet/palette.dart';
18
19 class ReceivePage extends BasePage {
22 - ReceivePage({this.addressListViewModel})
23 - : amountController = TextEditingController(),
24 - _formKey = GlobalKey<FormState>() {
25 - amountController.addListener(() => addressListViewModel.amount =
26 - _formKey.currentState.validate() ? amountController.text : '');
27 - }
20 + ReceivePage({this.addressListViewModel});
21
22 final WalletAddressListViewModel addressListViewModel;
30 - final TextEditingController amountController;
31 - final GlobalKey<FormState> _formKey;
32 -
33 - @override
34 - Color get backgroundLightColor => Colors.transparent;
23
24 @override
37 - Color get backgroundDarkColor => Colors.transparent;
25 + String get title => S.current.receive;
26
27 @override
40 - Widget Function(BuildContext, Widget) get rootWrapper =>
41 - (BuildContext context, Widget scaffold) => Container(
42 - decoration: BoxDecoration(
43 - gradient: LinearGradient(colors: [
44 - Theme.of(context).scaffoldBackgroundColor,
45 - Theme.of(context).primaryColor
46 - ], begin: Alignment.topLeft, end: Alignment.bottomRight)),
47 - child: scaffold);
28 + Color get backgroundLightColor => PaletteDark.backgroundColor;
29
30 @override
50 - Widget middle(BuildContext context) => Text(
51 - S.of(context).receive,
52 - style: TextStyle(
53 - fontSize: 18.0,
54 - fontWeight: FontWeight.bold,
55 - color: Theme.of(context).primaryTextTheme.title.color),
56 - );
31 + Color get backgroundDarkColor => PaletteDark.backgroundColor;
32
33 @override
34 Widget trailing(BuildContext context) {
35 final shareImage = Image.asset('assets/images/share.png',
61 - color: Theme.of(context).primaryTextTheme.title.color);
36 + color: Colors.white);
37
38 return SizedBox(
39 height: 20.0,
65 - width: 14.0,
40 + width: 20.0,
41 child: ButtonTheme(
42 minWidth: double.minPositive,
43 child: FlatButton(
69 - highlightColor: Colors.transparent,
70 - splashColor: Colors.transparent,
71 - padding: EdgeInsets.all(0),
72 - onPressed: () => Share.text(S.current.share_address,
73 - addressListViewModel.address.address, 'text/plain'),
74 - child: shareImage),
44 + highlightColor: Colors.transparent,
45 + splashColor: Colors.transparent,
46 + padding: EdgeInsets.all(0),
47 + onPressed: () => Share.text(S.current.share_address,
48 + addressListViewModel.address.address, 'text/plain'),
49 + child: shareImage),
50 ),
51 );
52 }
53
54 @override
55 Widget body(BuildContext context) {
81 - final copyImage = Image.asset('assets/images/copy_content.png',
82 - color: Theme.of(context).primaryTextTheme.title.color);
83 -
56 return SingleChildScrollView(
57 child: Column(
58 children: <Widget>[
87 - SizedBox(height: 25),
88 - Row(children: <Widget>[
89 - Spacer(flex: 4),
90 - Observer(
91 - builder: (_) => Flexible(
92 - flex: 6,
93 - child: Center(
94 - child: AspectRatio(
95 - aspectRatio: 1.0,
96 - child: QrImage(
97 - data: addressListViewModel.uri.toString(),
98 - backgroundColor: Colors.transparent,
99 - foregroundColor: Theme.of(context)
100 - .primaryTextTheme
101 - .display4
102 - .color,
103 - ))))),
104 - Spacer(flex: 4)
105 - ]),
59 Padding(
107 - padding: EdgeInsets.fromLTRB(24, 40, 24, 0),
108 - child: Row(
109 - children: <Widget>[
110 - Expanded(
111 - child: Form(
112 - key: _formKey,
113 - child: BaseTextFormField(
114 - controller: amountController,
115 - keyboardType:
116 - TextInputType.numberWithOptions(decimal: true),
117 - inputFormatters: [
118 - BlacklistingTextInputFormatter(
119 - RegExp('[\\-|\\ |\\,]'))
120 - ],
121 - textAlign: TextAlign.center,
122 - hintText: S.of(context).receive_amount,
123 - borderColor: Theme.of(context)
124 - .primaryTextTheme
125 - .headline5
126 - .color
127 - .withOpacity(0.4),
128 - validator: AmountValidator(),
129 - autovalidate: true,
130 - placeholderTextStyle: TextStyle(
131 - color: Theme.of(context)
132 - .primaryTextTheme
133 - .headline5
134 - .color,
135 - fontSize: 20,
136 - fontWeight: FontWeight.w600))))
137 - ],
60 + padding: EdgeInsets.fromLTRB(24, 80, 24, 40),
61 + child: QRWidget(
62 + addressListViewModel: addressListViewModel,
63 + isAmountFieldShow: true,
64 ),
65 ),
140 - Padding(
141 - padding: EdgeInsets.only(left: 24, right: 24, bottom: 40, top: 40),
142 - child: Builder(
143 - builder: (context) => Observer(
144 - builder: (context) => GestureDetector(
145 - onTap: () {
146 - Clipboard.setData(ClipboardData(
147 - text: addressListViewModel.address.address));
148 - Scaffold.of(context).showSnackBar(SnackBar(
149 - content: Text(
150 - S.of(context).copied_to_clipboard,
151 - style: TextStyle(color: Colors.white),
152 - ),
153 - backgroundColor: Colors.green,
154 - duration: Duration(milliseconds: 500),
155 - ));
156 - },
157 - child: Container(
158 - height: 48,
159 - padding: EdgeInsets.only(left: 24, right: 24),
160 - decoration: BoxDecoration(
161 - borderRadius:
162 - BorderRadius.all(Radius.circular(24)),
163 - color: Theme.of(context)
164 - .primaryTextTheme
165 - .overline
166 - .color),
167 - child: Row(
168 - mainAxisSize: MainAxisSize.max,
169 - children: <Widget>[
170 - Expanded(
171 - child: Text(
172 - addressListViewModel.address.address,
173 - maxLines: 1,
174 - overflow: TextOverflow.ellipsis,
175 - style: TextStyle(
176 - fontSize: 18,
177 - fontWeight: FontWeight.w500,
178 - color: Theme.of(context)
179 - .primaryTextTheme
180 - .title
181 - .color),
182 - ),
183 - ),
184 - Padding(
185 - padding: EdgeInsets.only(left: 12),
186 - child: copyImage,
187 - )
188 - ],
189 - ),
190 - ),
191 - ))),
192 - ),
66 Observer(
67 builder: (_) => ListView.separated(
68 separatorBuilder: (context, _) =>
196 - Divider(height: 1, color: Theme.of(context).dividerColor),
69 + Container(height: 1, color: PaletteDark.dividerColor),
70 shrinkWrap: true,
71 physics: NeverScrollableScrollPhysics(),
72 itemCount: addressListViewModel.items.length,
@@ -210,8 +83,7 @@ class ReceivePage extends BasePage {
83 icon: Icon(
84 Icons.arrow_forward_ios,
85 size: 14,
213 - color:
214 - Theme.of(context).primaryTextTheme.title.color,
86 + color: Colors.white,
87 ));
88 }
89
@@ -223,28 +95,40 @@ class ReceivePage extends BasePage {
95 icon: Icon(
96 Icons.add,
97 size: 20,
226 - color:
227 - Theme.of(context).primaryTextTheme.title.color,
98 + color: Colors.white,
99 ));
100 }
101
102 if (item is WalletAddressListItem) {
103 cell = Observer(
233 - builder: (_) => AddressCell.fromItem(item,
234 - isCurrent: item.address ==
235 - addressListViewModel.address.address,
236 - onTap: (_) => addressListViewModel.address = item,
237 - onEdit: () => Navigator.of(context).pushNamed(
238 - Routes.newSubaddress,
239 - arguments: item)));
104 + builder: (_) {
105 + final isCurrent = item.address ==
106 + addressListViewModel.address.address;
107 + final backgroundColor = isCurrent
108 + ? PaletteDark.lightOceanBlue
109 + : PaletteDark.nightBlue;
110 + final textColor = isCurrent
111 + ? Colors.blue
112 + : Colors.white;
113 +
114 + return AddressCell.fromItem(item,
115 + isCurrent: isCurrent,
116 + backgroundColor: backgroundColor,
117 + textColor: textColor,
118 + onTap: (_) => addressListViewModel.address = item,
119 + onEdit: () => Navigator.of(context).pushNamed(
120 + Routes.newSubaddress,
121 + arguments: item));
122 + }
123 + );
124 }
125
126 return index != 0
127 ? cell
128 : ClipRRect(
129 borderRadius: BorderRadius.only(
246 - topLeft: Radius.circular(24),
247 - topRight: Radius.circular(24)),
130 + topLeft: Radius.circular(30),
131 + topRight: Radius.circular(30)),
132 child: cell,
133 );
134 })),
lib/src/screens/receive/widgets/address_cell.dart
+14 -10
@@ -6,12 +6,16 @@ import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_i
6 class AddressCell extends StatelessWidget {
7 factory AddressCell.fromItem(WalletAddressListItem item,
8 {@required bool isCurrent,
9 + @required Color backgroundColor,
10 + @required Color textColor,
11 Function(String) onTap,
12 Function() onEdit}) =>
13 AddressCell(
14 address: item.address,
15 name: item.name,
16 isCurrent: isCurrent,
17 + backgroundColor: backgroundColor,
18 + textColor: textColor,
19 onTap: onTap,
20 onEdit: onEdit);
21
@@ -19,12 +23,16 @@ class AddressCell extends StatelessWidget {
23 {@required this.address,
24 @required this.name,
25 @required this.isCurrent,
26 + @required this.backgroundColor,
27 + @required this.textColor,
28 this.onTap,
29 this.onEdit});
30
31 final String address;
32 final String name;
33 final bool isCurrent;
34 + final Color backgroundColor;
35 + final Color textColor;
36 final Function(String) onTap;
37 final Function() onEdit;
38
@@ -32,23 +40,19 @@ class AddressCell extends StatelessWidget {
40
41 @override
42 Widget build(BuildContext context) {
35 - const currentTextColor = Colors.blue; // FIXME: Why it's defined here ?
36 - final currentColor =
37 - Theme.of(context).accentTextTheme.subtitle.decorationColor;
38 - final notCurrentColor = Theme.of(context).backgroundColor;
39 - final notCurrentTextColor =
40 - Theme.of(context).primaryTextTheme.caption.color;
43 final Widget cell = InkWell(
44 onTap: () => onTap(address),
45 child: Container(
44 - color: isCurrent ? currentColor : notCurrentColor,
46 + color: backgroundColor,
47 padding: EdgeInsets.only(left: 24, right: 24, top: 28, bottom: 28),
48 child: Text(
49 name ?? address,
50 + maxLines: 1,
51 + overflow: TextOverflow.ellipsis,
52 style: TextStyle(
49 - fontSize: name?.isNotEmpty ?? false ? 18 : 10,
53 + fontSize: 18,
54 fontWeight: FontWeight.w600,
51 - color: isCurrent ? currentTextColor : notCurrentTextColor,
55 + color: textColor,
56 ),
57 ),
58 ));
@@ -62,7 +66,7 @@ class AddressCell extends StatelessWidget {
66 secondaryActions: <Widget>[
67 IconSlideAction(
68 caption: S.of(context).edit,
65 - color: Theme.of(context).primaryTextTheme.overline.color,
69 + color: Colors.blue,
70 icon: Icons.edit,
71 onTap: () => onEdit?.call())
72 ]);
lib/src/screens/receive/widgets/header_tile.dart
+3 -3
@@ -23,7 +23,7 @@ class HeaderTile extends StatelessWidget {
23 top: 24,
24 bottom: 24
25 ),
26 - color: Theme.of(context).backgroundColor,
26 + color: PaletteDark.nightBlue,
27 child: Row(
28 mainAxisSize: MainAxisSize.max,
29 mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -33,7 +33,7 @@ class HeaderTile extends StatelessWidget {
33 style: TextStyle(
34 fontSize: 18,
35 fontWeight: FontWeight.w500,
36 - color: Theme.of(context).primaryTextTheme.title.color
36 + color: Colors.white
37 ),
38 ),
39 Container(
@@ -41,7 +41,7 @@ class HeaderTile extends StatelessWidget {
41 width: 32,
42 decoration: BoxDecoration(
43 shape: BoxShape.circle,
44 - color: Theme.of(context).primaryTextTheme.overline.color
44 + color: PaletteDark.distantNightBlue
45 ),
46 child: icon,
47 )
lib/src/screens/receive/widgets/qr_widget.dart
+9 -6
@@ -35,10 +35,10 @@ class QRWidget extends StatelessWidget {
35 crossAxisAlignment: CrossAxisAlignment.center,
36 children: <Widget>[
37 Row(children: <Widget>[
38 - Spacer(flex: 2),
38 + Spacer(flex: 3),
39 Observer(
40 builder: (_) => Flexible(
41 - flex: 3,
41 + flex: 5,
42 child: Center(
43 child: AspectRatio(
44 aspectRatio: 1.0,
@@ -47,12 +47,12 @@ class QRWidget extends StatelessWidget {
47 backgroundColor: Colors.transparent,
48 foregroundColor: PaletteDark.lightBlueGrey,
49 ))))),
50 - Spacer(flex: 2)
50 + Spacer(flex: 3)
51 ]),
52 Padding(
53 padding: EdgeInsets.only(top: 20),
54 child: Text(
55 - 'Scan the QR code to get the address',
55 + S.of(context).scan_qr_code,
56 style: TextStyle(
57 fontSize: 12,
58 fontWeight: FontWeight.w500,
@@ -62,7 +62,7 @@ class QRWidget extends StatelessWidget {
62 ),
63 isAmountFieldShow
64 ? Padding(
65 - padding: EdgeInsets.only(top: 60),
65 + padding: EdgeInsets.only(top: 40),
66 child: Row(
67 children: <Widget>[
68 Expanded(
@@ -78,8 +78,11 @@ class QRWidget extends StatelessWidget {
78 ],
79 textAlign: TextAlign.center,
80 hintText: S.of(context).receive_amount,
81 + textColor: Colors.white,
82 borderColor: PaletteDark.darkGrey,
82 - validator: AmountValidator(),
83 + validator: AmountValidator(
84 + type: addressListViewModel.type
85 + ),
86 autovalidate: true,
87 placeholderTextStyle: TextStyle(
88 color: PaletteDark.cyanBlue,
lib/src/screens/subaddress/address_edit_or_create_page.dart
+8
@@ -8,6 +8,7 @@ import 'package:cake_wallet/core/address_label_validator.dart';
8 import 'package:cake_wallet/src/widgets/primary_button.dart';
9 import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
10 import 'package:cake_wallet/src/screens/base_page.dart';
11 +import 'package:cake_wallet/palette.dart';
12
13 class AddressEditOrCreatePage extends BasePage {
14 AddressEditOrCreatePage({@required this.addressEditOrCreateViewModel})
@@ -28,6 +29,12 @@ class AddressEditOrCreatePage extends BasePage {
29 @override
30 String get title => S.current.new_subaddress_title;
31
32 + @override
33 + Color get backgroundLightColor => PaletteDark.backgroundColor;
34 +
35 + @override
36 + Color get backgroundDarkColor => PaletteDark.backgroundColor;
37 +
38 @override
39 Widget body(BuildContext context) {
40 reaction((_) => addressEditOrCreateViewModel.state,
@@ -48,6 +55,7 @@ class AddressEditOrCreatePage extends BasePage {
55 child: Center(
56 child: BaseTextFormField(
57 controller: _labelController,
58 + textColor: Colors.white,
59 hintText: S.of(context).new_subaddress_label_name,
60 validator: AddressLabelValidator()))),
61 Observer(
lib/src/widgets/alert_background.dart new
+26
@@ -0,0 +1,26 @@
1 +import 'dart:ui';
2 +import 'package:flutter/cupertino.dart';
3 +import 'package:flutter/material.dart';
4 +import 'package:cake_wallet/palette.dart';
5 +
6 +class AlertBackground extends StatelessWidget {
7 + AlertBackground({@required this.child});
8 +
9 + final Widget child;
10 +
11 + @override
12 + Widget build(BuildContext context) {
13 + return Container(
14 + height: double.infinity,
15 + width: double.infinity,
16 + color: Colors.transparent,
17 + child: BackdropFilter(
18 + filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0),
19 + child: Container(
20 + decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)),
21 + child: child,
22 + ),
23 + ),
24 + );
25 + }
26 +}
\ No newline at end of file
lib/src/widgets/alert_close_button.dart new
+28
@@ -0,0 +1,28 @@
1 +import 'package:flutter/material.dart';
2 +
3 +class AlertCloseButton extends StatelessWidget {
4 + AlertCloseButton({@required this.image});
5 +
6 + final Image image;
7 +
8 + @override
9 + Widget build(BuildContext context) {
10 + return Positioned(
11 + bottom: 24,
12 + child: GestureDetector(
13 + onTap: () => Navigator.of(context).pop(),
14 + child: Container(
15 + height: 42,
16 + width: 42,
17 + decoration: BoxDecoration(
18 + color: Colors.white,
19 + shape: BoxShape.circle
20 + ),
21 + child: Center(
22 + child: image,
23 + ),
24 + ),
25 + )
26 + );
27 + }
28 +}
\ No newline at end of file
lib/src/widgets/cake_scrollbar.dart new
+45
@@ -0,0 +1,45 @@
1 +import 'package:flutter/material.dart';
2 +import 'package:cake_wallet/palette.dart';
3 +
4 +class CakeScrollbar extends StatelessWidget {
5 + CakeScrollbar({
6 + @required this.backgroundHeight,
7 + @required this.thumbHeight,
8 + @required this.fromTop
9 + });
10 +
11 + final double backgroundHeight;
12 + final double thumbHeight;
13 + final double fromTop;
14 +
15 + @override
16 + Widget build(BuildContext context) {
17 + return Positioned(
18 + right: 6,
19 + child: Container(
20 + height: backgroundHeight,
21 + width: 6,
22 + decoration: BoxDecoration(
23 + color: PaletteDark.violetBlue,
24 + borderRadius: BorderRadius.all(Radius.circular(3))
25 + ),
26 + child: Stack(
27 + children: <Widget>[
28 + AnimatedPositioned(
29 + duration: Duration(milliseconds: 0),
30 + top: fromTop,
31 + child: Container(
32 + height: thumbHeight,
33 + width: 6.0,
34 + decoration: BoxDecoration(
35 + color: PaletteDark.wildBlueGrey,
36 + borderRadius: BorderRadius.all(Radius.circular(3))
37 + ),
38 + ),
39 + )
40 + ],
41 + ),
42 + )
43 + );
44 + }
45 +}
\ No newline at end of file
lib/store/dashboard/page_view_store.dart new
+19
@@ -0,0 +1,19 @@
1 +import 'package:mobx/mobx.dart';
2 +
3 +part 'page_view_store.g.dart';
4 +
5 +class PageViewStore = PageViewStoreBase with _$PageViewStore;
6 +
7 +abstract class PageViewStoreBase with Store {
8 + PageViewStoreBase() {
9 + setCurrentPage(1);
10 + }
11 +
12 + @observable
13 + double currentPage;
14 +
15 + @action
16 + void setCurrentPage(double currentPage) {
17 + this.currentPage = currentPage;
18 + }
19 +}
\ No newline at end of file
lib/view_model/dashboard/dashboard_view_model.dart
+8 -6
@@ -22,6 +22,7 @@ import 'package:cake_wallet/store/dashboard/trades_store.dart';
22 import 'package:cake_wallet/store/dashboard/trade_filter_store.dart';
23 import 'package:cake_wallet/store/dashboard/transaction_filter_store.dart';
24 import 'package:cake_wallet/view_model/dashboard/formatted_item_list.dart';
25 +import 'package:cake_wallet/store/dashboard/page_view_store.dart';
26
27 part 'dashboard_view_model.g.dart';
28
@@ -33,7 +34,8 @@ abstract class DashboardViewModelBase with Store {
34 this.appStore,
35 this.tradesStore,
36 this.tradeFilterStore,
36 - this.transactionFilterStore}) {
37 + this.transactionFilterStore,
38 + this.pageViewStore}) {
39
40 name = appStore.wallet?.name;
41 wallet ??= appStore.wallet;
@@ -53,8 +55,6 @@ abstract class DashboardViewModelBase with Store {
55 if (_wallet is MoneroWallet) {
56 subname = _wallet.account?.label;
57 }
56 -
57 - currentPage = 1;
58 }
59
60 @observable
@@ -63,15 +63,15 @@ abstract class DashboardViewModelBase with Store {
63 @observable
64 String name;
65
66 - @observable
67 - double currentPage;
68 -
66 @observable
67 ObservableList<TransactionListItem> transactions;
68
69 @observable
70 String subname;
71
72 + @computed
73 + double get currentPage => pageViewStore.currentPage;
74 +
75 @computed
76 String get address => wallet.address;
77
@@ -130,6 +130,8 @@ abstract class DashboardViewModelBase with Store {
130
131 TransactionFilterStore transactionFilterStore;
132
133 + PageViewStore pageViewStore;
134 +
135 ReactionDisposer _reaction;
136
137 void _onWalletChange(WalletBase wallet) {
lib/view_model/monero_account_list/monero_account_list_view_model.dart
+9 -1
@@ -9,7 +9,15 @@ class MoneroAccountListViewModel = MoneroAccountListViewModelBase
9 with _$MoneroAccountListViewModel;
10
11 abstract class MoneroAccountListViewModelBase with Store {
12 - MoneroAccountListViewModelBase(this._moneroWallet);
12 + MoneroAccountListViewModelBase(this._moneroWallet) : scrollOffsetFromTop = 0;
13 +
14 + @observable
15 + double scrollOffsetFromTop;
16 +
17 + @action
18 + void setScrollOffsetFromTop(double scrollOffsetFromTop) {
19 + this.scrollOffsetFromTop = scrollOffsetFromTop;
20 + }
21
22 @computed
23 List<AccountListItem> get accounts => _moneroWallet.accountList.accounts
lib/view_model/wallet_address_list/wallet_address_list_view_model.dart
+4
@@ -7,6 +7,7 @@ import 'package:cake_wallet/utils/list_item.dart';
7 import 'package:cake_wallet/view_model/wallet_address_list/wallet_account_list_header.dart';
8 import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_header.dart';
9 import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_item.dart';
10 +import 'package:cake_wallet/src/domain/common/wallet_type.dart';
11
12 part 'wallet_address_list_view_model.g.dart';
13
@@ -62,6 +63,9 @@ abstract class WalletAddressListViewModelBase with Store {
63 @observable
64 String amount;
65
66 + @computed
67 + WalletType get type => _wallet.type;
68 +
69 @computed
70 WalletAddressListItem get address => WalletAddressListItem(address: _wallet.address);
71
res/values/strings_de.arb
+2
@@ -137,6 +137,8 @@
137 "share_address" : "Adresse teilen ",
138 "receive_amount" : "Menge",
139 "subaddresses" : "Unteradressen",
140 + "addresses" : "Adressen",
141 + "scan_qr_code" : "Scannen Sie den QR-Code, um die Adresse zu erhalten",
142 "rename" : "Umbenennen",
143 "choose_account" : "Konto auswählen",
144 "create_new_account" : "Neues Konto erstellen",
res/values/strings_en.arb
+1
@@ -138,6 +138,7 @@
138 "receive_amount" : "Amount",
139 "subaddresses" : "Subaddresses",
140 "addresses" : "Addresses",
141 + "scan_qr_code" : "Scan the QR code to get the address",
142 "rename" : "Rename",
143 "choose_account" : "Choose account",
144 "create_new_account" : "Create new account",
res/values/strings_es.arb
+2
@@ -137,6 +137,8 @@
137 "share_address" : "Compartir dirección",
138 "receive_amount" : "Cantidad",
139 "subaddresses" : "Subdirecciones",
140 + "addresses" : "Direcciones",
141 + "scan_qr_code" : "Escanee el código QR para obtener la dirección",
142 "rename" : "Rebautizar",
143 "choose_account" : "Elegir cuenta",
144 "create_new_account" : "Crear una nueva cuenta",
res/values/strings_hi.arb
+2
@@ -137,6 +137,8 @@
137 "share_address" : "पता साझा करें",
138 "receive_amount" : "रकम",
139 "subaddresses" : "उप पते",
140 + "addresses" : "पतों",
141 + "scan_qr_code" : "पता प्राप्त करने के लिए QR कोड स्कैन करें",
142 "rename" : "नाम बदलें",
143 "choose_account" : "खाता चुनें",
144 "create_new_account" : "नया खाता बनाएँ",
res/values/strings_ja.arb
+2
@@ -137,6 +137,8 @@
137 "share_address" : "住所を共有する",
138 "receive_amount" : "量",
139 "subaddresses" : "サブアドレス",
140 + "addresses" : "住所",
141 + "scan_qr_code" : "QRコードをスキャンして住所を取得します",
142 "rename" : "リネーム",
143 "choose_account" : "アカウントを選択",
144 "create_new_account" : "新しいアカウントを作成する",
res/values/strings_ko.arb
+2
@@ -137,6 +137,8 @@
137 "share_address" : "주소 공유",
138 "receive_amount" : "양",
139 "subaddresses" : "하위 주소",
140 + "addresses" : "구애",
141 + "scan_qr_code" : "QR 코드를 스캔하여 주소를 얻습니다.",
142 "rename" : "이름 바꾸기",
143 "choose_account" : "계정을 선택하십시오",
144 "create_new_account" : "새 계정을 만들",
res/values/strings_nl.arb
+2
@@ -138,6 +138,8 @@
138 "receive_amount" : "Bedrag",
139 "subaddresses" : "Subadressen",
140 "rename" : "Hernoemen",
141 + "addresses" : "Adressen",
142 + "scan_qr_code" : "Scan de QR-code om het adres te krijgen",
143 "choose_account" : "Kies account",
144 "create_new_account" : "Creëer een nieuw account",
145 "accounts_subaddresses" : "Accounts en subadressen",
res/values/strings_pl.arb
+2
@@ -137,6 +137,8 @@
137 "share_address" : "Udostępnij adres",
138 "receive_amount" : "Ilość",
139 "subaddresses" : "Podadresy",
140 + "addresses" : "Adresy",
141 + "scan_qr_code" : "Zeskanuj kod QR, aby uzyskać adres",
142 "rename" : "Przemianować",
143 "choose_account" : "Wybierz konto",
144 "create_new_account" : "Stwórz nowe konto",
res/values/strings_pt.arb
+2
@@ -137,6 +137,8 @@
137 "share_address" : "Compartilhar endereço",
138 "receive_amount" : "Quantia",
139 "subaddresses" : "Sub-endereços",
140 + "addresses" : "Endereços",
141 + "scan_qr_code" : "Digitalize o código QR para obter o endereço",
142 "rename" : "Renomear",
143 "choose_account" : "Escolha uma conta",
144 "create_new_account" : "Criar nova conta",
res/values/strings_ru.arb
+2
@@ -137,6 +137,8 @@
137 "share_address" : "Поделиться адресом",
138 "receive_amount" : "Сумма",
139 "subaddresses" : "Субадреса",
140 + "addresses" : "Адреса",
141 + "scan_qr_code" : "Отсканируйте QR-код для получения адреса",
142 "rename" : "Переименовать",
143 "choose_account" : "Выберите аккаунт",
144 "create_new_account" : "Создать новый аккаунт",
res/values/strings_uk.arb
+2
@@ -137,6 +137,8 @@
137 "share_address" : "Поділитися адресою",
138 "receive_amount" : "Сума",
139 "subaddresses" : "Субадреси",
140 + "addresses" : "Адреси",
141 + "scan_qr_code" : "Скануйте QR-код для одержання адреси",
142 "rename" : "Перейменувати",
143 "choose_account" : "Оберіть акаунт",
144 "create_new_account" : "Створити новий акаунт",
res/values/strings_zh.arb
+2
@@ -137,6 +137,8 @@
137 "share_address" : "分享地址",
138 "receive_amount" : "量",
139 "subaddresses" : "子地址",
140 + "addresses" : "地址",
141 + "scan_qr_code" : "掃描二維碼獲取地址",
142 "rename" : "改名",
143 "choose_account" : "選擇帳號",
144 "create_new_account" : "建立新帳戶",