From d4e3e505cf6e0b6c0b3f913a47656bb0b72659a8 Mon Sep 17 00:00:00 2001 From: Matthew Fosse Date: Mon, 8 Apr 2024 17:06:54 -0700 Subject: [PATCH] updates --- lib/di.dart | 13 ++++++------ lib/router.dart | 21 ++++++++++++------- .../dashboard/pages/market_place_page.dart | 2 ++ 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/lib/di.dart b/lib/di.dart index 6b8d0dad9..4270f4298 100644 --- a/lib/di.dart +++ b/lib/di.dart @@ -15,7 +15,7 @@ import 'package:cake_wallet/entities/exchange_api_mode.dart'; import 'package:cake_wallet/entities/parse_address_from_domain.dart'; import 'package:cake_wallet/src/screens/dashboard/sign_page.dart'; import 'package:cake_wallet/src/screens/transaction_details/rbf_details_page.dart'; -import 'package:cake_wallet/view_model/dashboard/sign_message_view_model.dart'; +import 'package:cake_wallet/view_model/dashboard/sign_view_model.dart'; import 'package:cw_core/receive_page_option.dart'; import 'package:cake_wallet/ethereum/ethereum.dart'; import 'package:cake_wallet/nano/nano.dart'; @@ -1142,9 +1142,9 @@ Future setup({ getIt.registerFactory(() => IoniaAccountCardsPage(getIt.get())); getIt.registerFactoryParam( - (TransactionInfo transactionInfo, _) => RBFDetailsPage( + (TransactionInfo transactionInfo, _) => RBFDetailsPage( transactionDetailsViewModel: - getIt.get(param1: transactionInfo))); + getIt.get(param1: transactionInfo))); getIt.registerFactory(() => AnonPayApi( useTorOnly: getIt.get().exchangeStatus == ExchangeApiMode.torOnly, @@ -1205,12 +1205,11 @@ Future setup({ getIt.registerFactory( () => WalletConnectConnectionsView(web3walletService: getIt.get())); - - getIt.registerFactoryParam((signViewModel, _) => - SignPage(signViewModel)); - + getIt.registerFactory(() => NFTViewModel(appStore, getIt.get())); getIt.registerFactory(() => TorPage(getIt.get())); + getIt.registerFactory(() => SignViewModel(getIt.get().wallet!)); + _isSetupFinished = true; } diff --git a/lib/router.dart b/lib/router.dart index 9f5dfb838..46054cf81 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -15,6 +15,7 @@ import 'package:cake_wallet/src/screens/buy/webview_page.dart'; import 'package:cake_wallet/src/screens/dashboard/edit_token_page.dart'; import 'package:cake_wallet/src/screens/dashboard/home_settings_page.dart'; import 'package:cake_wallet/src/screens/dashboard/pages/nft_details_page.dart'; +import 'package:cake_wallet/src/screens/dashboard/sign_page.dart'; import 'package:cake_wallet/src/screens/nano/nano_change_rep_page.dart'; import 'package:cake_wallet/src/screens/nano_accounts/nano_account_edit_or_create_page.dart'; import 'package:cake_wallet/src/screens/nodes/pow_node_create_or_edit_page.dart'; @@ -61,6 +62,7 @@ import 'package:cake_wallet/src/screens/wallet_connect/wc_connections_listing_vi import 'package:cake_wallet/utils/payment_request.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:cake_wallet/view_model/dashboard/nft_view_model.dart'; +import 'package:cake_wallet/view_model/dashboard/sign_view_model.dart'; import 'package:cake_wallet/view_model/monero_account_list/account_list_item.dart'; import 'package:cake_wallet/view_model/node_list/node_create_or_edit_view_model.dart'; import 'package:cake_wallet/view_model/advanced_privacy_settings_view_model.dart'; @@ -151,7 +153,8 @@ Route createRoute(RouteSettings settings) { final walletNewVM = getIt.get(param1: type); final seedTypeViewModel = getIt.get(); - return CupertinoPageRoute(builder: (_) => NewWalletPage(walletNewVM, seedTypeViewModel)); + return CupertinoPageRoute( + builder: (_) => NewWalletPage(walletNewVM, seedTypeViewModel)); case Routes.setupPin: Function(PinCodeState, String)? callback; @@ -257,8 +260,7 @@ Route createRoute(RouteSettings settings) { case Routes.bumpFeePage: return CupertinoPageRoute( fullscreenDialog: true, - builder: (_) => - getIt.get(param1: settings.arguments as TransactionInfo)); + builder: (_) => getIt.get(param1: settings.arguments as TransactionInfo)); case Routes.newSubaddress: return CupertinoPageRoute( @@ -400,8 +402,7 @@ Route createRoute(RouteSettings settings) { case Routes.buySellPage: final args = settings.arguments as bool; - return MaterialPageRoute( - builder: (_) => getIt.get(param1: args)); + return MaterialPageRoute(builder: (_) => getIt.get(param1: args)); case Routes.buyWebView: final args = settings.arguments as List; @@ -424,8 +425,7 @@ Route createRoute(RouteSettings settings) { case Routes.preSeedPage: return MaterialPageRoute( - builder: (_) => getIt.get( - param1: settings.arguments as int)); + builder: (_) => getIt.get(param1: settings.arguments as int)); case Routes.backup: return CupertinoPageRoute( @@ -647,6 +647,13 @@ Route createRoute(RouteSettings settings) { case Routes.torPage: return MaterialPageRoute(builder: (_) => getIt.get()); + case Routes.signPage: + return MaterialPageRoute( + builder: (_) => SignPage( + getIt.get(), + ), + ); + default: return MaterialPageRoute( builder: (_) => Scaffold( diff --git a/lib/src/screens/dashboard/pages/market_place_page.dart b/lib/src/screens/dashboard/pages/market_place_page.dart index ddddd8015..984ab3ef7 100644 --- a/lib/src/screens/dashboard/pages/market_place_page.dart +++ b/lib/src/screens/dashboard/pages/market_place_page.dart @@ -68,6 +68,8 @@ class MarketPlacePage extends StatelessWidget { subTitle: S.of(context).cake_pay_web_cards_subtitle, ), + SizedBox(height: 20), + Observer( builder: (context) { if (!dashboardViewModel.hasSignMessages) {