fix desktop fusion view

This commit is contained in:
sneurlax 2023-07-26 17:21:13 -05:00
parent fe707ac381
commit 7c696f1a0c
3 changed files with 51 additions and 14 deletions

View file

@ -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<DesktopCashFusionView> {
),
),
),
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),
),
],
),
)
]),
),
);

View file

@ -109,7 +109,7 @@ class _MoreFeaturesDialogState extends ConsumerState<MoreFeaturesDialog> {
_MoreFeaturesItem(
label: "CashFusion",
detail: "Decentralized Bitcoin Cash mixing protocol",
iconAsset: Assets.svg.robotHead,
iconAsset: Assets.svg.cashFusion,
onPressed: () => widget.onFusionPressed?.call(),
),
const SizedBox(

View file

@ -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,