add stub xpub settings view

This commit is contained in:
sneurlax 2023-04-06 14:28:11 -05:00
parent 1df6701972
commit d3f45f14b6
3 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,55 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/background.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
class XPubView extends ConsumerStatefulWidget {
const XPubView({Key? key}) : super(key: key);
static const String routeName = "/xpub";
@override
ConsumerState<XPubView> createState() => _XPubViewState();
}
class _XPubViewState extends ConsumerState<XPubView> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Background(
child: Scaffold(
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
Navigator.of(context).pop();
},
),
title: Text(
"Wallet xPub",
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
padding: const EdgeInsets.only(
top: 12,
left: 16,
right: 16,
),
child: Text("TODO"),
),
),
);
}
}

View file

@ -10,6 +10,7 @@ import 'package:stackwallet/pages/home_view/home_view.dart';
import 'package:stackwallet/pages/pinpad_views/lock_screen_view.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/debug_view.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/xpub_view.dart';
import 'package:stackwallet/pages/settings_views/sub_widgets/settings_list_button.dart';
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart';
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart';
@ -57,6 +58,7 @@ class WalletSettingsView extends StatefulWidget {
class _WalletSettingsViewState extends State<WalletSettingsView> {
late final String walletId;
late final Coin coin;
late final bool xPubEnabled;
late final EventBus eventBus;
@ -70,6 +72,8 @@ class _WalletSettingsViewState extends State<WalletSettingsView> {
void initState() {
walletId = widget.walletId;
coin = widget.coin;
xPubEnabled =
coin != Coin.monero && coin != Coin.wownero && coin != Coin.epicCash;
_currentSyncStatus = widget.initialSyncStatus;
// _currentNodeStatus = widget.initialNodeStatus;
@ -281,6 +285,19 @@ class _WalletSettingsViewState extends State<WalletSettingsView> {
.pushNamed(DebugView.routeName);
},
),
if (xPubEnabled)
const SizedBox(
height: 8,
),
if (xPubEnabled)
SettingsListButton(
iconAssetName: Assets.svg.eye,
title: "Wallet xPub",
onPressed: () {
Navigator.of(context)
.pushNamed(XPubView.routeName);
},
),
],
),
),

View file

@ -84,6 +84,7 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/support_vi
import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/xpub_view.dart';
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart';
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart';
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_view.dart';
@ -397,6 +398,12 @@ class RouteGenerator {
builder: (_) => const DebugView(),
settings: RouteSettings(name: settings.name));
case XPubView.routeName:
return getRoute(
shouldUseMaterialRoute: useMaterialPageRoute,
builder: (_) => const XPubView(),
settings: RouteSettings(name: settings.name));
case AppearanceSettingsView.routeName:
return getRoute(
shouldUseMaterialRoute: useMaterialPageRoute,