From dcdc411d41a281d85501177a99b4453b5f946322 Mon Sep 17 00:00:00 2001 From: M Date: Sat, 26 Sep 2020 15:19:33 +0300 Subject: [PATCH] Fixes --- lib/router.dart | 4 ++-- lib/src/screens/dashboard/dashboard_page.dart | 16 +++++-------- .../dashboard/widgets/balance_page.dart | 2 +- .../screens/wallet_list/wallet_list_page.dart | 3 ++- lib/src/screens/welcome/welcome_page.dart | 4 ++-- .../dashboard/balance_view_model.dart | 4 ++++ pubspec.lock | 23 ++++++++++++------- 7 files changed, 32 insertions(+), 24 deletions(-) diff --git a/lib/router.dart b/lib/router.dart index 5ae418395..5213758f2 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -67,7 +67,7 @@ class Router { .pushNamed(Routes.newWallet, arguments: type))); case Routes.newWallet: - final type = settings.arguments as WalletType; + final type = WalletType.monero; // settings.arguments as WalletType; final walletNewVM = getIt.get(param1: type); return CupertinoPageRoute( @@ -97,7 +97,7 @@ class Router { builder: (_) => RestoreOptionsPage(type: type)); case Routes.restoreWalletOptions: - final type = settings.arguments as WalletType; + final type = WalletType.monero; //settings.arguments as WalletType; return CupertinoPageRoute( builder: (_) => RestoreWalletOptionsPage( diff --git a/lib/src/screens/dashboard/dashboard_page.dart b/lib/src/screens/dashboard/dashboard_page.dart index 16cce7518..fecaec430 100644 --- a/lib/src/screens/dashboard/dashboard_page.dart +++ b/lib/src/screens/dashboard/dashboard_page.dart @@ -108,17 +108,13 @@ class DashboardPage extends BasePage { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ ActionButton( - image: sendImage, - title: S.of(context).send, - route: Routes.send, - alignment: Alignment.centerLeft, - ), + image: sendImage, + title: S.of(context).send, + route: Routes.send), ActionButton( - image: sendImage, - title: S.of(context).send, - route: Routes.send, - alignment: Alignment.centerLeft, - ), + image: exchangeImage, + title: S.of(context).exchange, + route: Routes.exchange), ], ), ) diff --git a/lib/src/screens/dashboard/widgets/balance_page.dart b/lib/src/screens/dashboard/widgets/balance_page.dart index 519f21960..e6c0ccef7 100644 --- a/lib/src/screens/dashboard/widgets/balance_page.dart +++ b/lib/src/screens/dashboard/widgets/balance_page.dart @@ -20,7 +20,7 @@ class BalancePage extends StatelessWidget { children: [ Observer(builder: (_) { return Text( - dashboardViewModel.wallet.currency.toString(), + dashboardViewModel.balanceViewModel.currency.toString(), style: TextStyle( fontSize: 40, fontWeight: FontWeight.bold, diff --git a/lib/src/screens/wallet_list/wallet_list_page.dart b/lib/src/screens/wallet_list/wallet_list_page.dart index 694c338e4..0b845f3ed 100644 --- a/lib/src/screens/wallet_list/wallet_list_page.dart +++ b/lib/src/screens/wallet_list/wallet_list_page.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/src/screens/wallet_list/widgets/wallet_menu_alert.dart'; +import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; @@ -73,7 +74,7 @@ class WalletListBodyState extends State { return GestureDetector( onTap: () { - showDialog( + showPopUp( context: context, builder: (dialogContext) { return WalletMenuAlert( diff --git a/lib/src/screens/welcome/welcome_page.dart b/lib/src/screens/welcome/welcome_page.dart index 78cd04835..aa0d5b80c 100644 --- a/lib/src/screens/welcome/welcome_page.dart +++ b/lib/src/screens/welcome/welcome_page.dart @@ -103,7 +103,7 @@ class WelcomePage extends BasePage { Padding( padding: EdgeInsets.only(top: 24), child: PrimaryImageButton( - onPressed: () => Navigator.pushNamed(context, Routes.newWalletFromWelcome), + onPressed: () => Navigator.pushNamed(context, Routes.newWallet), image: newWalletImage, text: S.of(context).create_new, color: Theme.of(context).accentTextTheme.subtitle.decorationColor, @@ -113,7 +113,7 @@ class WelcomePage extends BasePage { Padding( padding: EdgeInsets.only(top: 10), child: PrimaryImageButton( - onPressed: () => Navigator.pushNamed(context, Routes.restoreWalletOptionsFromWelcome), + onPressed: () => Navigator.pushNamed(context, Routes.restoreWalletOptions), image: restoreWalletImage, text: S.of(context).restore_wallet, color: Theme.of(context).accentTextTheme.caption.color, diff --git a/lib/view_model/dashboard/balance_view_model.dart b/lib/view_model/dashboard/balance_view_model.dart index 23fd578f1..58978c946 100644 --- a/lib/view_model/dashboard/balance_view_model.dart +++ b/lib/view_model/dashboard/balance_view_model.dart @@ -1,5 +1,6 @@ import 'package:cake_wallet/bitcoin/bitcoin_wallet.dart'; import 'package:cake_wallet/core/wallet_base.dart'; +import 'package:cake_wallet/entities/crypto_currency.dart'; import 'package:cake_wallet/monero/monero_wallet.dart'; import 'package:cake_wallet/entities/balance_display_mode.dart'; import 'package:cake_wallet/entities/calculate_fiat_amount.dart'; @@ -92,6 +93,9 @@ abstract class BalanceViewModelBase with Store { return null; } + @computed + CryptoCurrency get currency => appStore.wallet.currency; + String _getFiatBalance({double price, String cryptoAmount}) { if (cryptoAmount == null) { return '0.00'; diff --git a/pubspec.lock b/pubspec.lock index df34727ee..612b1ac91 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -42,7 +42,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.1" + version: "2.4.2" auto_size_text: dependency: "direct main" description: @@ -210,7 +210,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.12" + version: "1.14.13" connectivity: dependency: "direct main" description: @@ -330,6 +330,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.2" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" ffi: dependency: transitive description: @@ -547,7 +554,7 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.6" + version: "0.12.8" meta: dependency: transitive description: @@ -617,7 +624,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.4" + version: "1.7.0" path_drawing: dependency: transitive description: @@ -867,7 +874,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.9.5" stream_channel: dependency: transitive description: @@ -902,7 +909,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.15" + version: "0.2.17" time: dependency: transitive description: @@ -923,7 +930,7 @@ packages: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.2.0" url_launcher: dependency: "direct main" description: @@ -1023,5 +1030,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.7.0 <3.0.0" + dart: ">=2.9.0-14.0.dev <3.0.0" flutter: ">=1.12.13+hotfix.5 <2.0.0"