Design fixes.

M committed Sep 26, 2020 at 14:17 UTC 162e9e5712934d98671441a1d75b58aa27933841
4 files changed +96 -106
lib/src/screens/dashboard/widgets/action_button.dart
+1
@@ -36,6 +36,7 @@ class ActionButton extends StatelessWidget {
36 child: image,
37 ),
38 ),
39 + SizedBox(height: 15),
40 Text(
41 title,
42 style: TextStyle(fontSize: 14, color: Colors.white),
lib/src/screens/dashboard/widgets/balance_page.dart
+28 -40
@@ -18,45 +18,34 @@ class BalancePage extends StatelessWidget {
18 mainAxisAlignment: MainAxisAlignment.spaceBetween,
19 crossAxisAlignment: CrossAxisAlignment.center,
20 children: <Widget>[
21 - Observer(
22 - builder: (_) {
23 - return Text(
24 - dashboardViewModel.wallet.currency.toString(),
25 - style: TextStyle(
26 - fontSize: 40,
27 - fontWeight: FontWeight.bold,
28 - color: Theme.of(context).indicatorColor,
29 - height: 1
30 - ),
31 - );
32 - }
33 - ),
34 - Observer(
35 - builder: (_) {
36 - return Text(
37 - dashboardViewModel.balanceViewModel.cryptoBalance,
38 - style: TextStyle(
39 - fontSize: 54,
40 - fontWeight: FontWeight.bold,
41 - color: Colors.white,
42 - height: 1
43 - ),
44 - );
45 - }
46 - ),
47 - Observer(
48 - builder: (_) {
49 - return Text(
50 - dashboardViewModel.balanceViewModel.fiatBalance,
51 - style: TextStyle(
52 - fontSize: 18,
53 - fontWeight: FontWeight.w500,
54 - color: Theme.of(context).indicatorColor,
55 - height: 1
56 - ),
57 - );
58 - }
59 - ),
21 + Observer(builder: (_) {
22 + return Text(
23 + dashboardViewModel.wallet.currency.toString(),
24 + style: TextStyle(
25 + fontSize: 40,
26 + fontWeight: FontWeight.bold,
27 + color: Theme.of(context).indicatorColor,
28 + height: 1),
29 + );
30 + }),
31 + Observer(builder: (_) {
32 + return Text(dashboardViewModel.balanceViewModel.cryptoBalance,
33 + style: TextStyle(
34 + fontSize: 54,
35 + fontWeight: FontWeight.bold,
36 + color: Colors.white,
37 + height: 1),
38 + textAlign: TextAlign.center);
39 + }),
40 + Observer(builder: (_) {
41 + return Text(dashboardViewModel.balanceViewModel.fiatBalance,
42 + style: TextStyle(
43 + fontSize: 18,
44 + fontWeight: FontWeight.w500,
45 + color: Theme.of(context).indicatorColor,
46 + height: 1),
47 + textAlign: TextAlign.center);
48 + }),
49 ],
50 ),
51 ),
@@ -64,4 +53,3 @@ class BalancePage extends StatelessWidget {
53 );
54 }
55 }
67 -
lib/src/screens/dashboard/widgets/transaction_raw.dart
+63 -65
@@ -3,13 +3,13 @@ import 'package:cake_wallet/entities/transaction_direction.dart';
3 import 'package:cake_wallet/generated/i18n.dart';
4
5 class TransactionRow extends StatelessWidget {
6 - TransactionRow({
7 - this.direction,
8 - this.formattedDate,
9 - this.formattedAmount,
10 - this.formattedFiatAmount,
11 - this.isPending,
12 - @required this.onTap});
6 + TransactionRow(
7 + {this.direction,
8 + this.formattedDate,
9 + this.formattedAmount,
10 + this.formattedFiatAmount,
11 + this.isPending,
12 + @required this.onTap});
13
14 final VoidCallback onTap;
15 final TransactionDirection direction;
@@ -23,75 +23,73 @@ class TransactionRow extends StatelessWidget {
23 return InkWell(
24 onTap: onTap,
25 child: Container(
26 - height: 52,
26 + height: 62,
27 color: Colors.transparent,
28 padding: EdgeInsets.only(left: 24, right: 24),
29 child: Row(
30 crossAxisAlignment: CrossAxisAlignment.center,
31 children: <Widget>[
32 - Container(
33 - height: 36,
34 - width: 36,
35 - decoration: BoxDecoration(
36 - shape: BoxShape.circle,
37 - color: Theme.of(context).textTheme.overline.decorationColor
38 - ),
39 - child: Image.asset(
40 - direction == TransactionDirection.incoming
41 - ? 'assets/images/down_arrow.png'
42 - : 'assets/images/up_arrow.png'),
43 - ),
32 Expanded(
45 - child: Padding(
46 - padding: const EdgeInsets.only(left: 12),
47 - child: Container(
48 - height: 46,
49 - child: Column(
50 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
51 - mainAxisSize: MainAxisSize.max,
52 - children: <Widget>[
53 - Row(
54 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
55 - children: <Widget>[
56 - Text(
57 - (direction == TransactionDirection.incoming
33 + child: Container(
34 + height: 56,
35 + child: Column(
36 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
37 + mainAxisSize: MainAxisSize.max,
38 + children: <Widget>[
39 + Row(
40 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
41 + children: <Widget>[
42 + Text(
43 + (direction == TransactionDirection.incoming
44 ? S.of(context).received
45 : S.of(context).sent) +
60 - (isPending ? S.of(context).pending : ''),
61 - style: TextStyle(
62 - fontSize: 16,
63 - fontWeight: FontWeight.w500,
64 - color: Colors.white
65 - )),
66 - Text(direction == TransactionDirection.incoming
67 - ? formattedAmount
68 - : '- ' + formattedAmount,
46 + (isPending ? S.of(context).pending : ''),
47 + style: TextStyle(
48 + fontSize: 16,
49 + fontWeight: FontWeight.w500,
50 + color: Colors.white)),
51 + Container(
52 + decoration: BoxDecoration(
53 + borderRadius:
54 + BorderRadius.all(Radius.circular(10)),
55 + color: (direction ==
56 + TransactionDirection.incoming
57 + ? Colors.green.withOpacity(0.8)
58 + : Theme.of(context)
59 + .accentTextTheme
60 + .body2
61 + .decorationColor
62 + .withOpacity(0.8))),
63 + padding: EdgeInsets.only(
64 + top: 3, bottom: 3, left: 10, right: 10),
65 + child: Text(formattedAmount,
66 style: TextStyle(
67 fontSize: 16,
68 fontWeight: FontWeight.w500,
72 - color: Colors.white
73 - ))
74 - ]),
75 - Row(
76 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
77 - children: <Widget>[
78 - Text(formattedDate,
79 - style: TextStyle(
80 - fontSize: 14,
81 - color: Theme.of(context).textTheme
82 - .overline.backgroundColor)),
83 - Text(direction == TransactionDirection.incoming
84 - ? formattedFiatAmount
85 - : '- ' + formattedFiatAmount,
86 - style: TextStyle(
87 - fontSize: 14,
88 - color: Theme.of(context).textTheme
89 - .overline.backgroundColor))
90 - ]),
91 - ],
92 - ),
93 - ),
94 - ))
69 + color: Colors.white)))
70 + ]),
71 + Row(
72 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
73 + children: <Widget>[
74 + Text(formattedDate,
75 + style: TextStyle(
76 + fontSize: 14,
77 + color: Theme.of(context)
78 + .textTheme
79 + .overline
80 + .backgroundColor)),
81 + Text(formattedFiatAmount,
82 + style: TextStyle(
83 + fontSize: 14,
84 + color: Theme.of(context)
85 + .textTheme
86 + .overline
87 + .backgroundColor))
88 + ]),
89 + ],
90 + ),
91 + ),
92 + )
93 ]),
94 ));
95 }
lib/view_model/settings/settings_view_model.dart
+4 -1
@@ -40,7 +40,9 @@ abstract class SettingsViewModelBase with Store {
40 PickerListItem(
41 title: S.current.settings_display_balance_as,
42 items: BalanceDisplayMode.all,
43 - selectedItem: () => balanceDisplayMode),
43 + selectedItem: () => balanceDisplayMode,
44 + onItemSelected: (BalanceDisplayMode mode) =>
45 + _settingsStore.balanceDisplayMode = mode),
46 PickerListItem(
47 title: S.current.settings_currency,
48 items: FiatCurrency.all,
@@ -204,6 +206,7 @@ abstract class SettingsViewModelBase with Store {
206 @action
207 void setFiatCurrency(FiatCurrency value) =>
208 _settingsStore.fiatCurrency = value;
209 +
210 @action
211 void setShouldSaveRecipientAddress(bool value) =>
212 _settingsStore.shouldSaveRecipientAddress = value;