From 7c696f1a0cfbd3923095d68845924380e05d7086 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 26 Jul 2023 17:21:13 -0500 Subject: [PATCH] fix desktop fusion view --- .../cashfusion/desktop_cashfusion_view.dart | 33 +++++++++++-------- .../more_features/more_features_dialog.dart | 2 +- lib/route_generator.dart | 30 +++++++++++++++++ 3 files changed, 51 insertions(+), 14 deletions(-) diff --git a/lib/pages_desktop_specific/cashfusion/desktop_cashfusion_view.dart b/lib/pages_desktop_specific/cashfusion/desktop_cashfusion_view.dart index 00790240a..88da3b5f5 100644 --- a/lib/pages_desktop_specific/cashfusion/desktop_cashfusion_view.dart +++ b/lib/pages_desktop_specific/cashfusion/desktop_cashfusion_view.dart @@ -11,6 +11,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:stackwallet/providers/global/wallets_provider.dart'; +import 'package:stackwallet/services/mixins/fusion_interface.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -93,21 +95,26 @@ class _DesktopCashFusion extends ConsumerState { ), ), ), - body: const Padding( - padding: EdgeInsets.all(24), + body: Padding( + padding: const EdgeInsets.all(24), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - Expanded( - child: SingleChildScrollView( - // child: FusionParticipantList( - // walletId: widget.walletId, - // ), - child: Text("TODO FusionParticipantList"), - ), - ), - ], + const Text("TODO FusionParticipantList"), + const SizedBox( + height: 16, ), + TextButton( + onPressed: () => { + (ref + .read(walletsChangeNotifierProvider) + .getManager(widget.walletId) + .wallet as FusionInterface) + .fuse() + }, + child: Text( + "Fuse", + style: STextStyles.desktopTextMedium(context), + ), + ) ]), ), ); diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/more_features/more_features_dialog.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/more_features/more_features_dialog.dart index 8cf55de76..1b3a9620e 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/more_features/more_features_dialog.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/more_features/more_features_dialog.dart @@ -109,7 +109,7 @@ class _MoreFeaturesDialogState extends ConsumerState { _MoreFeaturesItem( label: "CashFusion", detail: "Decentralized Bitcoin Cash mixing protocol", - iconAsset: Assets.svg.robotHead, + iconAsset: Assets.svg.cashFusion, onPressed: () => widget.onFusionPressed?.call(), ), const SizedBox( diff --git a/lib/route_generator.dart b/lib/route_generator.dart index 66239aaf7..fc47e40b1 100644 --- a/lib/route_generator.dart +++ b/lib/route_generator.dart @@ -41,6 +41,7 @@ import 'package:stackwallet/pages/address_book_views/subviews/edit_contact_name_ import 'package:stackwallet/pages/buy_view/buy_in_wallet_view.dart'; import 'package:stackwallet/pages/buy_view/buy_quote_preview.dart'; import 'package:stackwallet/pages/buy_view/buy_view.dart'; +import 'package:stackwallet/pages/cashfusion/cashfusion_view.dart'; import 'package:stackwallet/pages/coin_control/coin_control_view.dart'; import 'package:stackwallet/pages/coin_control/utxo_details_view.dart'; import 'package:stackwallet/pages/exchange_view/choose_from_stack_view.dart'; @@ -125,6 +126,7 @@ import 'package:stackwallet/pages/wallets_view/wallets_overview.dart'; import 'package:stackwallet/pages/wallets_view/wallets_view.dart'; import 'package:stackwallet/pages_desktop_specific/address_book_view/desktop_address_book.dart'; import 'package:stackwallet/pages_desktop_specific/addresses/desktop_wallet_addresses_view.dart'; +import 'package:stackwallet/pages_desktop_specific/cashfusion/desktop_cashfusion_view.dart'; import 'package:stackwallet/pages_desktop_specific/coin_control/desktop_coin_control_view.dart'; // import 'package:stackwallet/pages_desktop_specific/desktop_exchange/desktop_all_buys_view.dart'; import 'package:stackwallet/pages_desktop_specific/desktop_buy/desktop_buy_view.dart'; @@ -462,6 +464,34 @@ class RouteGenerator { } return _routeError("${settings.name} invalid args: ${args.toString()}"); + case CashFusionView.routeName: + if (args is String) { + return getRoute( + shouldUseMaterialRoute: useMaterialPageRoute, + builder: (_) => CashFusionView( + walletId: args, + ), + settings: RouteSettings( + name: settings.name, + ), + ); + } + return _routeError("${settings.name} invalid args: ${args.toString()}"); + + case DesktopCashFusionView.routeName: + if (args is String) { + return getRoute( + shouldUseMaterialRoute: useMaterialPageRoute, + builder: (_) => DesktopCashFusionView( + walletId: args, + ), + settings: RouteSettings( + name: settings.name, + ), + ); + } + return _routeError("${settings.name} invalid args: ${args.toString()}"); + case GlobalSettingsView.routeName: return getRoute( shouldUseMaterialRoute: useMaterialPageRoute,