diff --git a/lib/src/screens/dashboard/widgets/action_button.dart b/lib/src/screens/dashboard/widgets/action_button.dart index dc9a64bbf..9f9fbc418 100644 --- a/lib/src/screens/dashboard/widgets/action_button.dart +++ b/lib/src/screens/dashboard/widgets/action_button.dart @@ -36,6 +36,7 @@ class ActionButton extends StatelessWidget { child: image, ), ), + SizedBox(height: 15), Text( title, style: TextStyle(fontSize: 14, color: Colors.white), diff --git a/lib/src/screens/dashboard/widgets/balance_page.dart b/lib/src/screens/dashboard/widgets/balance_page.dart index 4cd3fe2a0..519f21960 100644 --- a/lib/src/screens/dashboard/widgets/balance_page.dart +++ b/lib/src/screens/dashboard/widgets/balance_page.dart @@ -18,45 +18,34 @@ class BalancePage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Observer( - builder: (_) { - return Text( - dashboardViewModel.wallet.currency.toString(), - style: TextStyle( - fontSize: 40, - fontWeight: FontWeight.bold, - color: Theme.of(context).indicatorColor, - height: 1 - ), - ); - } - ), - Observer( - builder: (_) { - return Text( - dashboardViewModel.balanceViewModel.cryptoBalance, - style: TextStyle( - fontSize: 54, - fontWeight: FontWeight.bold, - color: Colors.white, - height: 1 - ), - ); - } - ), - Observer( - builder: (_) { - return Text( - dashboardViewModel.balanceViewModel.fiatBalance, - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.w500, - color: Theme.of(context).indicatorColor, - height: 1 - ), - ); - } - ), + Observer(builder: (_) { + return Text( + dashboardViewModel.wallet.currency.toString(), + style: TextStyle( + fontSize: 40, + fontWeight: FontWeight.bold, + color: Theme.of(context).indicatorColor, + height: 1), + ); + }), + Observer(builder: (_) { + return Text(dashboardViewModel.balanceViewModel.cryptoBalance, + style: TextStyle( + fontSize: 54, + fontWeight: FontWeight.bold, + color: Colors.white, + height: 1), + textAlign: TextAlign.center); + }), + Observer(builder: (_) { + return Text(dashboardViewModel.balanceViewModel.fiatBalance, + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w500, + color: Theme.of(context).indicatorColor, + height: 1), + textAlign: TextAlign.center); + }), ], ), ), @@ -64,4 +53,3 @@ class BalancePage extends StatelessWidget { ); } } - diff --git a/lib/src/screens/dashboard/widgets/transaction_raw.dart b/lib/src/screens/dashboard/widgets/transaction_raw.dart index 13e3bd2be..14d07a9fc 100644 --- a/lib/src/screens/dashboard/widgets/transaction_raw.dart +++ b/lib/src/screens/dashboard/widgets/transaction_raw.dart @@ -3,13 +3,13 @@ import 'package:cake_wallet/entities/transaction_direction.dart'; import 'package:cake_wallet/generated/i18n.dart'; class TransactionRow extends StatelessWidget { - TransactionRow({ - this.direction, - this.formattedDate, - this.formattedAmount, - this.formattedFiatAmount, - this.isPending, - @required this.onTap}); + TransactionRow( + {this.direction, + this.formattedDate, + this.formattedAmount, + this.formattedFiatAmount, + this.isPending, + @required this.onTap}); final VoidCallback onTap; final TransactionDirection direction; @@ -23,75 +23,73 @@ class TransactionRow extends StatelessWidget { return InkWell( onTap: onTap, child: Container( - height: 52, + height: 62, color: Colors.transparent, padding: EdgeInsets.only(left: 24, right: 24), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Container( - height: 36, - width: 36, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).textTheme.overline.decorationColor - ), - child: Image.asset( - direction == TransactionDirection.incoming - ? 'assets/images/down_arrow.png' - : 'assets/images/up_arrow.png'), - ), Expanded( - child: Padding( - padding: const EdgeInsets.only(left: 12), - child: Container( - height: 46, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - (direction == TransactionDirection.incoming + child: Container( + height: 56, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + (direction == TransactionDirection.incoming ? S.of(context).received : S.of(context).sent) + - (isPending ? S.of(context).pending : ''), + (isPending ? S.of(context).pending : ''), + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Colors.white)), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(10)), + color: (direction == + TransactionDirection.incoming + ? Colors.green.withOpacity(0.8) + : Theme.of(context) + .accentTextTheme + .body2 + .decorationColor + .withOpacity(0.8))), + padding: EdgeInsets.only( + top: 3, bottom: 3, left: 10, right: 10), + child: Text(formattedAmount, style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Colors.white - )), - Text(direction == TransactionDirection.incoming - ? formattedAmount - : '- ' + formattedAmount, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - color: Colors.white - )) - ]), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text(formattedDate, - style: TextStyle( - fontSize: 14, - color: Theme.of(context).textTheme - .overline.backgroundColor)), - Text(direction == TransactionDirection.incoming - ? formattedFiatAmount - : '- ' + formattedFiatAmount, - style: TextStyle( - fontSize: 14, - color: Theme.of(context).textTheme - .overline.backgroundColor)) - ]), - ], - ), - ), - )) + color: Colors.white))) + ]), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(formattedDate, + style: TextStyle( + fontSize: 14, + color: Theme.of(context) + .textTheme + .overline + .backgroundColor)), + Text(formattedFiatAmount, + style: TextStyle( + fontSize: 14, + color: Theme.of(context) + .textTheme + .overline + .backgroundColor)) + ]), + ], + ), + ), + ) ]), )); } diff --git a/lib/view_model/settings/settings_view_model.dart b/lib/view_model/settings/settings_view_model.dart index 61ffda19b..bac456e79 100644 --- a/lib/view_model/settings/settings_view_model.dart +++ b/lib/view_model/settings/settings_view_model.dart @@ -40,7 +40,9 @@ abstract class SettingsViewModelBase with Store { PickerListItem( title: S.current.settings_display_balance_as, items: BalanceDisplayMode.all, - selectedItem: () => balanceDisplayMode), + selectedItem: () => balanceDisplayMode, + onItemSelected: (BalanceDisplayMode mode) => + _settingsStore.balanceDisplayMode = mode), PickerListItem( title: S.current.settings_currency, items: FiatCurrency.all, @@ -204,6 +206,7 @@ abstract class SettingsViewModelBase with Store { @action void setFiatCurrency(FiatCurrency value) => _settingsStore.fiatCurrency = value; + @action void setShouldSaveRecipientAddress(bool value) => _settingsStore.shouldSaveRecipientAddress = value;