mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-24 12:29:37 +00:00
add CashFusionView
This commit is contained in:
parent
1a0d47d5c7
commit
d3832a56b5
1 changed files with 131 additions and 0 deletions
131
lib/pages/cashfusion/cashfusion_view.dart
Normal file
131
lib/pages/cashfusion/cashfusion_view.dart
Normal file
|
@ -0,0 +1,131 @@
|
||||||
|
/*
|
||||||
|
* This file is part of Stack Wallet.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2023 Cypher Stack
|
||||||
|
* All Rights Reserved.
|
||||||
|
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
||||||
|
* Generated by sneurlax on 2023-07-26
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
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/show_loading.dart';
|
||||||
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
|
import 'package:stackwallet/widgets/background.dart';
|
||||||
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
|
|
||||||
|
class CashFusionView extends ConsumerStatefulWidget {
|
||||||
|
const CashFusionView({
|
||||||
|
super.key,
|
||||||
|
required this.walletId,
|
||||||
|
});
|
||||||
|
|
||||||
|
static const routeName = "/cashFusionView";
|
||||||
|
|
||||||
|
final String walletId;
|
||||||
|
|
||||||
|
@override
|
||||||
|
ConsumerState<CashFusionView> createState() => _CashFusionViewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CashFusionViewState extends ConsumerState<CashFusionView> {
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Background(
|
||||||
|
child: SafeArea(
|
||||||
|
child: Scaffold(
|
||||||
|
backgroundColor:
|
||||||
|
Theme.of(context).extension<StackColors>()!.background,
|
||||||
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
|
leading: const AppBarBackButton(),
|
||||||
|
title: Text(
|
||||||
|
"CashFusion",
|
||||||
|
style: STextStyles.navBarTitle(context),
|
||||||
|
),
|
||||||
|
titleSpacing: 0,
|
||||||
|
actions: [
|
||||||
|
AspectRatio(
|
||||||
|
aspectRatio: 1,
|
||||||
|
child: AppBarIconButton(
|
||||||
|
size: 36,
|
||||||
|
icon: SvgPicture.asset(
|
||||||
|
Assets.svg.arrowRotate,
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.topNavIconPrimary,
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
// show loading for a minimum of 2 seconds on refreshing
|
||||||
|
await showLoading(
|
||||||
|
whileFuture: Future.wait<void>([
|
||||||
|
Future.delayed(const Duration(seconds: 2)),
|
||||||
|
(ref
|
||||||
|
.read(walletsChangeNotifierProvider)
|
||||||
|
.getManager(widget.walletId)
|
||||||
|
.wallet as FusionInterface)
|
||||||
|
.refreshFusion()
|
||||||
|
]),
|
||||||
|
context: context,
|
||||||
|
message: "Refreshing...");
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 16,
|
||||||
|
right: 16,
|
||||||
|
top: 8,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
// child: CashFusionParticipantList(
|
||||||
|
// walletId: widget.walletId,
|
||||||
|
// ),
|
||||||
|
child: Text(
|
||||||
|
"TODO CashFusionView",
|
||||||
|
style: STextStyles.desktopTextMedium(context),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => {
|
||||||
|
(ref
|
||||||
|
.read(walletsChangeNotifierProvider)
|
||||||
|
.getManager(widget.walletId)
|
||||||
|
.wallet as FusionInterface)
|
||||||
|
.fuse()
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
"Fuse",
|
||||||
|
style: STextStyles.desktopTextMedium(context),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue