CAKE-15 | implemented new design to dashboard page; created balance page; applied sync indicator to balance page; applied action buttons, page view and dots indicator to dashboard page; added colors of dashboard page to palette

Oleksandr Sobol committed Jul 21, 2020 at 20:22 UTC 12ee8a519d6245d3253a366797a5fea1f849ec93
16 files changed +399 -132
assets/images/download.png
Binary files /dev/null and b/assets/images/download.png differ
assets/images/filter_icon.png
Binary files /dev/null and b/assets/images/filter_icon.png differ
assets/images/menu.png
Binary files /dev/null and b/assets/images/menu.png differ
assets/images/transfer.png
Binary files /dev/null and b/assets/images/transfer.png differ
assets/images/triangle.png
Binary files a/assets/images/triangle.png and b/assets/images/triangle.png differ
assets/images/upload.png
Binary files /dev/null and b/assets/images/upload.png differ
lib/generated/i18n.dart
+1 -23
@@ -24,7 +24,6 @@ class S implements WidgetsLocalizations {
24 String get account => "Account";
25 String get accounts => "Accounts";
26 String get accounts_subaddresses => "Accounts and subaddresses";
27 - String get addresses => "Addresses";
27 String get add => "Add";
28 String get add_new_node => "Add new node";
29 String get add_new_word => "Add new word";
@@ -32,6 +31,7 @@ class S implements WidgetsLocalizations {
31 String get address_book_menu => "Address book";
32 String get address_remove_contact => "Remove contact";
33 String get address_remove_content => "Are you sure that you want to remove selected contact?";
34 + String get addresses => "Addresses";
35 String get all => "ALL";
36 String get amount => "Amount: ";
37 String get amount_is_estimate => "The receive amount is an estimate";
@@ -643,8 +643,6 @@ class $de extends S {
643 @override
644 String get accounts_subaddresses => "Konten und Unteradressen";
645 @override
646 - String get addresses => "Addressen";
647 - @override
646 String get wallet_name => "Walletname";
647 @override
648 String get error_text_payment_id => "Die Zahlungs-ID kann nur 16 bis 64 hexadezimale Zeichen enthalten";
@@ -1265,8 +1263,6 @@ class $hi extends S {
1263 @override
1264 String get accounts_subaddresses => "लेखा और उपदेस";
1265 @override
1268 - String get addresses => "पतों";
1269 - @override
1266 String get wallet_name => "बटुए का नाम";
1267 @override
1268 String get error_text_payment_id => "पेमेंट आईडी केवल हेक्स में 16 से 64 चार्ट तक हो सकती है";
@@ -1887,8 +1883,6 @@ class $ru extends S {
1883 @override
1884 String get accounts_subaddresses => "Аккаунты и субадреса";
1885 @override
1890 - String get addresses => "Адреса";
1891 - @override
1886 String get wallet_name => "Имя кошелька";
1887 @override
1888 String get error_text_payment_id => "Идентификатор платежа может содержать от 16 до 64 символов в hex";
@@ -2509,8 +2503,6 @@ class $ko extends S {
2503 @override
2504 String get accounts_subaddresses => "계정 및 하위 주소";
2505 @override
2512 - String get addresses => "구애";
2513 - @override
2506 String get wallet_name => "지갑 이름";
2507 @override
2508 String get error_text_payment_id => "지불 ID는 16 ~ 64 자의 16 진 문자 만 포함 할 수 있습니다";
@@ -3131,8 +3123,6 @@ class $pt extends S {
3123 @override
3124 String get accounts_subaddresses => "Contas e sub-endereços";
3125 @override
3134 - String get addresses => "Endereços";
3135 - @override
3126 String get wallet_name => "Nome da carteira";
3127 @override
3128 String get error_text_payment_id => "O ID de pagamento pode conter apenas de 16 a 64 caracteres em hexadecimal";
@@ -3753,8 +3743,6 @@ class $uk extends S {
3743 @override
3744 String get accounts_subaddresses => "Акаунти та субадреси";
3745 @override
3756 - String get addresses => "Адреси";
3757 - @override
3746 String get wallet_name => "Ім'я гаманця";
3747 @override
3748 String get error_text_payment_id => "Ідентифікатор платежу може містити від 16 до 64 символів в hex";
@@ -4375,8 +4363,6 @@ class $ja extends S {
4363 @override
4364 String get accounts_subaddresses => "アカウントとサブアドレス";
4365 @override
4378 - String get addresses => "アドレス";
4379 - @override
4366 String get wallet_name => "ウォレット名";
4367 @override
4368 String get error_text_payment_id => "支払いIDには、16進数で16〜64文字しか含めることができません";
@@ -5001,8 +4987,6 @@ class $pl extends S {
4987 @override
4988 String get accounts_subaddresses => "Konta i podadresy";
4989 @override
5004 - String get addresses => "Adresy";
5005 - @override
4990 String get wallet_name => "Nazwa portfela";
4991 @override
4992 String get error_text_payment_id => "ID może zawierać od 16 do 64 znaków w formacie szesnastkowym";
@@ -5623,8 +5607,6 @@ class $es extends S {
5607 @override
5608 String get accounts_subaddresses => "Cuentas y subdirecciones";
5609 @override
5626 - String get addresses => "Direcciones";
5627 - @override
5610 String get wallet_name => "Nombre de la billetera";
5611 @override
5612 String get error_text_payment_id => "La ID de pago solo puede contener de 16 a 64 caracteres en hexadecimal";
@@ -6245,8 +6227,6 @@ class $nl extends S {
6227 @override
6228 String get accounts_subaddresses => "Accounts en subadressen";
6229 @override
6248 - String get addresses => "Adressen";
6249 - @override
6230 String get wallet_name => "Portemonnee naam";
6231 @override
6232 String get error_text_payment_id => "Betalings-ID kan alleen 16 tot 64 tekens bevatten in hexadecimale volgorde";
@@ -6867,8 +6847,6 @@ class $zh extends S {
6847 @override
6848 String get accounts_subaddresses => "帳戶和子地址";
6849 @override
6870 - String get addresses => "地址";
6871 - @override
6850 String get wallet_name => "钱包名称";
6851 @override
6852 String get error_text_payment_id => "付款ID只能包含16到64个字符(十六进制)";
lib/palette.dart
+12 -2
@@ -20,7 +20,6 @@ class Palette {
20 class PaletteDark {
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 nightBlue = Color.fromRGBO(45, 56, 95, 1.0); // walletCardBottomEndSync
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
25 static const Color moderateBlue = Color.fromRGBO(63, 77, 122, 1.0); // walletCardSubAddressField
@@ -28,8 +27,19 @@ class PaletteDark {
27 static const Color pigeonBlue = Color.fromRGBO(91, 112, 146, 1.0); // historyPanelText
28 static const Color moderateNightBlue = Color.fromRGBO(39, 53, 96, 1.0); // historyPanelButton
29 static const Color headerNightBlue = Color.fromRGBO(41, 52, 84, 1.0); // menuHeader
31 - static const Color lightNightBlue = Color.fromRGBO(48, 59, 95, 1.0); // menuList
30 + //static const Color lightNightBlue = Color.fromRGBO(48, 59, 95, 1.0); // menuList
31 static const Color moderatePurpleBlue = Color.fromRGBO(57, 74, 95, 1.0); // selectButtonText
32 +
33 + // NEW DESIGN
34 + static const Color backgroundColor = Color.fromRGBO(25, 35, 60, 1.0);
35 + static const Color nightBlue = Color.fromRGBO(35, 47, 79, 1.0);
36 + static const Color cyanBlue = Color.fromRGBO(99, 113, 150, 1.0);
37 + static const Color orangeYellow = Color.fromRGBO(243, 166, 50, 1.0);
38 + static const Color brightGreen = Color.fromRGBO(88, 243, 50, 1.0);
39 + static const Color oceanBlue = Color.fromRGBO(27, 39, 71, 1.0);
40 + static const Color lightNightBlue = Color.fromRGBO(39, 52, 89, 1.0);
41 + static const Color wildBlue = Color.fromRGBO(165, 176, 205, 1.0);
42 +
43 // FIXME: Rename.
44 static const Color eee = Color.fromRGBO(236, 239, 245, 1.0);
45 static const Color xxx = Color.fromRGBO(72, 89, 109, 1);
lib/src/screens/dashboard/dashboard_page.dart
+120 -107
@@ -4,49 +4,43 @@ import 'package:flutter/material.dart';
4 import 'package:flutter/cupertino.dart';
5 import 'package:cake_wallet/view_model/dashboard_view_model.dart';
6 import 'package:cake_wallet/src/screens/base_page.dart';
7 -import 'package:cake_wallet/src/screens/dashboard/widgets/wallet_card.dart';
8 -import 'package:cake_wallet/src/screens/dashboard/widgets/trade_history_panel.dart';
7 import 'package:cake_wallet/src/screens/dashboard/widgets/menu_widget.dart';
8 +import 'package:cake_wallet/palette.dart';
9 +import 'package:dots_indicator/dots_indicator.dart';
10 +import 'package:cake_wallet/src/screens/dashboard/widgets/action_button.dart';
11 +import 'package:cake_wallet/src/screens/dashboard/widgets/balance_page.dart';
12 +import 'package:flutter_mobx/flutter_mobx.dart';
13 +import 'package:mobx/mobx.dart';
14
15 class DashboardPage extends BasePage {
16 DashboardPage({@required this.walletViewModel});
17
18 @override
15 - Color get backgroundLightColor => Colors.transparent;
19 + Color get backgroundLightColor => PaletteDark.backgroundColor;
20
21 @override
18 - Color get backgroundDarkColor => Colors.transparent;
19 -
20 - @override
21 - Widget Function(BuildContext, Widget) get rootWrapper =>
22 - (BuildContext context, Widget scaffold) => Container(
23 - decoration: BoxDecoration(
24 - gradient: LinearGradient(colors: [
25 - Theme.of(context).scaffoldBackgroundColor,
26 - Theme.of(context).primaryColor
27 - ], begin: Alignment.topLeft, end: Alignment.bottomRight)),
28 - child: scaffold);
22 + Color get backgroundDarkColor => PaletteDark.backgroundColor;
23
24 @override
25 Widget trailing(BuildContext context) {
32 - final menuButton = Image.asset('assets/images/header.png',
33 - color: Theme.of(context).primaryTextTheme.title.color);
26 + final menuButton = Image.asset('assets/images/menu.png',
27 + color: Colors.white);
28
29 return Container(
30 alignment: Alignment.centerRight,
31 child: SizedBox(
38 - width: 24,
32 + width: 20,
33 child: FlatButton(
34 highlightColor: Colors.transparent,
35 splashColor: Colors.transparent,
36 padding: EdgeInsets.all(0),
37 onPressed: () async {
38 await showDialog<void>(
45 - builder: (_) => MenuWidget(
46 - name: walletViewModel.name,
47 - subname: walletViewModel.subname,
48 - type: walletViewModel.type),
49 - context: context);
39 + builder: (_) => MenuWidget(
40 + name: walletViewModel.name,
41 + subname: walletViewModel.subname,
42 + type: walletViewModel.type),
43 + context: context);
44 },
45 child: menuButton),
46 ),
@@ -54,97 +48,116 @@ class DashboardPage extends BasePage {
48 }
49
50 final DashboardViewModel walletViewModel;
57 - final sendImage = Image.asset('assets/images/send.png');
58 - final exchangeImage = Image.asset('assets/images/exchange.png');
59 - final buyImage = Image.asset('assets/images/coins.png');
51 + final sendImage = Image.asset('assets/images/upload.png');
52 + final exchangeImage = Image.asset('assets/images/transfer.png');
53 + final receiveImage = Image.asset('assets/images/download.png');
54 + final controller = PageController(initialPage: 0);
55 +
56 + var pages = <Widget>[];
57 + bool _isEffectsInstalled = false;
58
59 @override
60 Widget body(BuildContext context) {
63 - return LayoutBuilder(builder: (context, constraints) {
64 - final transactionListMinHeight =
65 - constraints.heightConstraints().maxHeight - 345 - 32;
61
67 - return SingleChildScrollView(
68 - child: Column(children: [
69 - Container(
70 - height: 345,
71 - child: Column(children: [
72 - Padding(
73 - padding: EdgeInsets.only(left: 24, top: 10),
74 - child: WalletCard(walletVM: walletViewModel)),
75 - Container(
76 - padding: EdgeInsets.only(left: 44, right: 44, top: 32),
77 - child: Row(
78 - children: <Widget>[
79 - Flexible(
80 - child: actionButton(
81 - context: context,
82 - image: sendImage,
83 - title: S.of(context).send,
84 - route: Routes.send)),
85 - Flexible(
86 - child: actionButton(
87 - context: context,
88 - image: exchangeImage,
89 - title: S.of(context).exchange,
90 - route: Routes.exchange)),
91 - ],
92 - ),
62 + _setEffects();
63 +
64 + return SafeArea(
65 + child: Column(
66 + mainAxisSize: MainAxisSize.max,
67 + children: <Widget>[
68 + Expanded(
69 + child: PageView.builder(
70 + controller: controller,
71 + itemCount: pages.length,
72 + itemBuilder: (context, index) {
73 + return pages[index];
74 + }
75 )
94 - ])),
95 - SizedBox(height: 32),
96 - ConstrainedBox(
97 - constraints: BoxConstraints(minHeight: transactionListMinHeight),
98 - child: TradeHistoryPanel(dashboardViewModel: walletViewModel)),
99 -// Column(children: [
100 -// Text('1'),
101 -// Text('2')
102 -// ])
103 - ]));
104 - });
76 + ),
77 + Padding(
78 + padding: EdgeInsets.only(
79 + bottom: 24
80 + ),
81 + child: Observer(
82 + builder: (_) {
83 + return DotsIndicator(
84 + dotsCount: pages.length,
85 + position: walletViewModel.currentPage,
86 + decorator: DotsDecorator(
87 + color: PaletteDark.cyanBlue,
88 + activeColor: Colors.white,
89 + size: Size(6, 6),
90 + activeSize: Size(6, 6),
91 + ),
92 + );
93 + }
94 + ),
95 + ),
96 + Container(
97 + width: double.infinity,
98 + padding: EdgeInsets.only(
99 + left: 45,
100 + right: 45,
101 + bottom: 24
102 + ),
103 + child: Row(
104 + children: <Widget>[
105 + Flexible(
106 + child: ActionButton(
107 + image: sendImage,
108 + title: S.of(context).send,
109 + route: Routes.send,
110 + alignment: Alignment.centerLeft,
111 + ),
112 + ),
113 + Flexible(
114 + child: ActionButton(
115 + image: exchangeImage,
116 + title: S.of(context).exchange,
117 + route: Routes.exchange
118 + ),
119 + ),
120 + Flexible(
121 + child: ActionButton(
122 + image: receiveImage,
123 + title: S.of(context).receive,
124 + route: Routes.receive,
125 + alignment: Alignment.centerRight,
126 + ),
127 + )
128 + ],
129 + ),
130 + )
131 + ],
132 + )
133 + );
134 }
106 -}
135
108 -Widget actionButton(
109 - {BuildContext context,
110 - @required Image image,
111 - @required String title,
112 - @required String route}) {
113 - return Container(
114 - width: MediaQuery.of(context).size.width,
115 - child: Column(
116 - mainAxisAlignment: MainAxisAlignment.start,
117 - crossAxisAlignment: CrossAxisAlignment.center,
118 - children: <Widget>[
119 - GestureDetector(
120 - onTap: () {
121 - if (route.isNotEmpty) {
122 - Navigator.of(context, rootNavigator: true).pushNamed(route);
123 - }
124 - },
125 - child: Container(
126 - height: 48,
127 - width: 48,
128 - alignment: Alignment.center,
129 - decoration: BoxDecoration(
130 - color: Theme.of(context).primaryTextTheme.subhead.color,
131 - shape: BoxShape.circle),
132 - child: image,
133 - ),
136 + void _setEffects() {
137 + if (_isEffectsInstalled) {
138 + return;
139 + }
140 +
141 + pages.add(BalancePage(dashboardViewModel: walletViewModel));
142 + pages.add(Center(
143 + child: Text(
144 + 'SECOND PAGE',
145 + style: TextStyle(
146 + color: Colors.white
147 ),
135 - Padding(
136 - padding: EdgeInsets.only(top: 12),
137 - child: Text(
138 - title,
139 - style: TextStyle(
140 - fontSize: 16,
141 - fontWeight: FontWeight.w600,
142 - color: Color.fromRGBO(140, 153, 201,
143 - 0.8) // Theme.of(context).primaryTextTheme.caption.color
144 - ),
145 - ),
146 - )
147 - ],
148 - ),
149 - );
148 + ),
149 + ));
150 +
151 + controller.addListener(() {
152 + walletViewModel.currentPage = controller.page;
153 + });
154 +
155 + reaction((_) => walletViewModel.currentPage, (double currentPage) {
156 + if (controller.page != currentPage) {
157 + controller.jumpTo(currentPage);
158 + }
159 + });
160 +
161 + _isEffectsInstalled = true;
162 + }
163 }
lib/src/screens/dashboard/widgets/action_button.dart new
+55
@@ -0,0 +1,55 @@
1 +import 'package:flutter/material.dart';
2 +import 'package:cake_wallet/palette.dart';
3 +
4 +class ActionButton extends StatelessWidget{
5 + ActionButton({
6 + @required this.image,
7 + @required this.title,
8 + @required this.route,
9 + this.alignment = Alignment.center
10 + });
11 +
12 + final Image image;
13 + final String title;
14 + final String route;
15 + final Alignment alignment;
16 +
17 + @override
18 + Widget build(BuildContext context) {
19 + return Container(
20 + width: double.infinity,
21 + height: 93,
22 + alignment: alignment,
23 + child: Column(
24 + mainAxisSize: MainAxisSize.max,
25 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
26 + crossAxisAlignment: CrossAxisAlignment.center,
27 + children: <Widget>[
28 + GestureDetector(
29 + onTap: () {
30 + if (route.isNotEmpty) {
31 + Navigator.of(context, rootNavigator: true).pushNamed(route);
32 + }
33 + },
34 + child: Container(
35 + height: 60,
36 + width: 60,
37 + alignment: Alignment.center,
38 + decoration: BoxDecoration(
39 + color: PaletteDark.nightBlue,
40 + shape: BoxShape.circle),
41 + child: image,
42 + ),
43 + ),
44 + Text(
45 + title,
46 + style: TextStyle(
47 + fontSize: 14,
48 + color: Colors.white
49 + ),
50 + )
51 + ],
52 + ),
53 + );
54 + }
55 +}
\ No newline at end of file
lib/src/screens/dashboard/widgets/balance_page.dart new
+91
@@ -0,0 +1,91 @@
1 +import 'package:flutter/material.dart';
2 +import 'package:cake_wallet/view_model/dashboard_view_model.dart';
3 +import 'package:cake_wallet/palette.dart';
4 +import 'package:flutter_mobx/flutter_mobx.dart';
5 +import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator.dart';
6 +
7 +class BalancePage extends StatelessWidget {
8 + BalancePage({@required this.dashboardViewModel});
9 +
10 + final DashboardViewModel dashboardViewModel;
11 + final triangleImage = Image.asset('assets/images/triangle.png');
12 +
13 + @override
14 + Widget build(BuildContext context) {
15 + return Container(
16 + padding: EdgeInsets.only(
17 + top: 12,
18 + left: 24,
19 + right: 24,
20 + bottom: 24
21 + ),
22 + child: Stack(
23 + alignment: Alignment.center,
24 + children: <Widget>[
25 + Positioned(
26 + top: 0,
27 + child: SyncIndicator(dashboardViewModel: dashboardViewModel)
28 + ),
29 + Container(
30 + height: 160,
31 + child: Column(
32 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
33 + crossAxisAlignment: CrossAxisAlignment.center,
34 + children: <Widget>[
35 + Observer(
36 + builder: (_) {
37 + return Row(
38 + mainAxisSize: MainAxisSize.min,
39 + crossAxisAlignment: CrossAxisAlignment.center,
40 + children: <Widget>[
41 + Text(
42 + dashboardViewModel.wallet.currency.toString(),
43 + style: TextStyle(
44 + fontSize: 40,
45 + fontWeight: FontWeight.bold,
46 + color: PaletteDark.cyanBlue,
47 + height: 1
48 + ),
49 + ),
50 + Padding(
51 + padding: EdgeInsets.only(left: 8),
52 + child: triangleImage,
53 + )
54 + ],
55 + );
56 + }
57 + ),
58 + Observer(
59 + builder: (_) {
60 + return Text(
61 + dashboardViewModel.balance.totalBalance,
62 + style: TextStyle(
63 + fontSize: 54,
64 + fontWeight: FontWeight.bold,
65 + color: Colors.white,
66 + height: 1
67 + ),
68 + );
69 + }
70 + ),
71 + Observer(
72 + builder: (_) {
73 + return Text(
74 + '\$ 0.00',
75 + style: TextStyle(
76 + fontSize: 18,
77 + color: PaletteDark.cyanBlue,
78 + height: 1
79 + ),
80 + );
81 + }
82 + ),
83 + ],
84 + ),
85 + )
86 + ],
87 + ),
88 + );
89 + }
90 +}
91 +
lib/src/screens/dashboard/widgets/sync_indicator.dart new
+86
@@ -0,0 +1,86 @@
1 +import 'package:flutter/material.dart';
2 +import 'package:cake_wallet/view_model/dashboard_view_model.dart';
3 +import 'package:cake_wallet/palette.dart';
4 +import 'package:flutter_mobx/flutter_mobx.dart';
5 +import 'package:cake_wallet/src/domain/common/sync_status.dart';
6 +
7 +class SyncIndicator extends StatelessWidget {
8 + SyncIndicator({@required this.dashboardViewModel});
9 +
10 + final DashboardViewModel dashboardViewModel;
11 +
12 + @override
13 + Widget build(BuildContext context) {
14 + return Observer(
15 + builder: (_) {
16 + final syncIndicatorWidth = 250.0;
17 + final status = dashboardViewModel.status;
18 + final statusText = status.title();
19 + final progress = status.progress();
20 + final indicatorOffset = progress * syncIndicatorWidth;
21 + final indicatorWidth =
22 + progress <= 1 ? syncIndicatorWidth - indicatorOffset : 0.0;
23 + final indicatorColor = status is SyncedSyncStatus
24 + ? PaletteDark.brightGreen
25 + : PaletteDark.orangeYellow;
26 +
27 + return ClipRRect(
28 + borderRadius: BorderRadius.all(Radius.circular(15)),
29 + child: Container(
30 + height: 30,
31 + width: syncIndicatorWidth,
32 + color: PaletteDark.lightNightBlue,
33 + child: Stack(
34 + alignment: Alignment.center,
35 + children: <Widget>[
36 + progress <= 1
37 + ? Positioned(
38 + left: indicatorOffset,
39 + top: 0,
40 + bottom: 0,
41 + child: Container(
42 + width: indicatorWidth,
43 + height: 30,
44 + color: PaletteDark.oceanBlue,
45 + )
46 + )
47 + : Offstage(),
48 + Padding(
49 + padding: EdgeInsets.only(
50 + left: 24,
51 + right: 24
52 + ),
53 + child: Row(
54 + mainAxisSize: MainAxisSize.max,
55 + mainAxisAlignment: MainAxisAlignment.center,
56 + crossAxisAlignment: CrossAxisAlignment.center,
57 + children: <Widget>[
58 + Container(
59 + height: 4,
60 + width: 4,
61 + decoration: BoxDecoration(
62 + shape: BoxShape.circle,
63 + color: indicatorColor
64 + ),
65 + ),
66 + Padding(
67 + padding: EdgeInsets.only(left: 6),
68 + child: Text(
69 + statusText,
70 + style: TextStyle(
71 + fontSize: 12,
72 + color: PaletteDark.wildBlue
73 + ),
74 + ),
75 + )
76 + ],
77 + ),
78 + )
79 + ],
80 + ),
81 + ),
82 + );
83 + }
84 + );
85 + }
86 +}
\ No newline at end of file
lib/view_model/dashboard_view_model.dart
+25
@@ -9,6 +9,7 @@ import 'package:cake_wallet/core/wallet_base.dart';
9 import 'package:cake_wallet/src/domain/common/sync_status.dart';
10 import 'package:cake_wallet/src/domain/common/wallet_type.dart';
11 import 'package:cake_wallet/store/app_store.dart';
12 +import 'package:cake_wallet/generated/i18n.dart';
13
14 part 'dashboard_view_model.g.dart';
15
@@ -35,6 +36,8 @@ abstract class DashboardViewModelBase with Store {
36 if (_wallet is MoneroWallet) {
37 subname = _wallet.account?.label;
38 }
39 +
40 + currentPage = 0;
41 }
42
43 @observable
@@ -43,12 +46,34 @@ abstract class DashboardViewModelBase with Store {
46 @observable
47 String name;
48
49 + @observable
50 + double currentPage;
51 +
52 @computed
53 String get address => wallet.address;
54
55 @computed
56 SyncStatus get status => wallet.syncStatus;
57
58 + @computed
59 + String get syncStatusText {
60 + var statusText = '';
61 +
62 + if (status is SyncingSyncStatus) {
63 + statusText = S.current
64 + .Blocks_remaining(
65 + status.toString());
66 + }
67 +
68 + if (status is FailedSyncStatus) {
69 + statusText = S
70 + .current
71 + .please_try_to_connect_to_another_node;
72 + }
73 +
74 + return statusText;
75 + }
76 +
77 @computed
78 WalletBalace get balance {
79 final wallet = this.wallet;
pubspec.lock
+7
@@ -267,6 +267,13 @@ packages:
267 url: "https://pub.dartlang.org"
268 source: hosted
269 version: "3.0.7"
270 + dots_indicator:
271 + dependency: "direct main"
272 + description:
273 + name: dots_indicator
274 + url: "https://pub.dartlang.org"
275 + source: hosted
276 + version: "1.2.0"
277 dotted_border:
278 dependency: "direct main"
279 description:
pubspec.yaml
+1
@@ -50,6 +50,7 @@ dependencies:
50 devicelocale: ^0.2.1
51 auto_size_text: ^2.1.0
52 dotted_border: ^1.0.5
53 + dots_indicator: ^1.2.0
54
55 # The following adds the Cupertino Icons font to your application.
56 # Use with the CupertinoIcons class for iOS style icons.
res/values/strings_en.arb
+1
@@ -137,6 +137,7 @@
137 "share_address" : "Share address",
138 "receive_amount" : "Amount",
139 "subaddresses" : "Subaddresses",
140 + "addresses" : "Addresses",
141 "rename" : "Rename",
142 "choose_account" : "Choose account",
143 "create_new_account" : "Create new account",