mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 11:59:30 +00:00
add stub xpub settings view
This commit is contained in:
parent
1df6701972
commit
d3f45f14b6
3 changed files with 79 additions and 0 deletions
55
lib/pages/settings_views/global_settings_view/xpub_view.dart
Normal file
55
lib/pages/settings_views/global_settings_view/xpub_view.dart
Normal 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"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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/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/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/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/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_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_network_settings_view/wallet_network_settings_view.dart';
|
||||||
|
@ -57,6 +58,7 @@ class WalletSettingsView extends StatefulWidget {
|
||||||
class _WalletSettingsViewState extends State<WalletSettingsView> {
|
class _WalletSettingsViewState extends State<WalletSettingsView> {
|
||||||
late final String walletId;
|
late final String walletId;
|
||||||
late final Coin coin;
|
late final Coin coin;
|
||||||
|
late final bool xPubEnabled;
|
||||||
|
|
||||||
late final EventBus eventBus;
|
late final EventBus eventBus;
|
||||||
|
|
||||||
|
@ -70,6 +72,8 @@ class _WalletSettingsViewState extends State<WalletSettingsView> {
|
||||||
void initState() {
|
void initState() {
|
||||||
walletId = widget.walletId;
|
walletId = widget.walletId;
|
||||||
coin = widget.coin;
|
coin = widget.coin;
|
||||||
|
xPubEnabled =
|
||||||
|
coin != Coin.monero && coin != Coin.wownero && coin != Coin.epicCash;
|
||||||
|
|
||||||
_currentSyncStatus = widget.initialSyncStatus;
|
_currentSyncStatus = widget.initialSyncStatus;
|
||||||
// _currentNodeStatus = widget.initialNodeStatus;
|
// _currentNodeStatus = widget.initialNodeStatus;
|
||||||
|
@ -281,6 +285,19 @@ class _WalletSettingsViewState extends State<WalletSettingsView> {
|
||||||
.pushNamed(DebugView.routeName);
|
.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);
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -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_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/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/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_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_network_settings_view/wallet_network_settings_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_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(),
|
builder: (_) => const DebugView(),
|
||||||
settings: RouteSettings(name: settings.name));
|
settings: RouteSettings(name: settings.name));
|
||||||
|
|
||||||
|
case XPubView.routeName:
|
||||||
|
return getRoute(
|
||||||
|
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||||
|
builder: (_) => const XPubView(),
|
||||||
|
settings: RouteSettings(name: settings.name));
|
||||||
|
|
||||||
case AppearanceSettingsView.routeName:
|
case AppearanceSettingsView.routeName:
|
||||||
return getRoute(
|
return getRoute(
|
||||||
shouldUseMaterialRoute: useMaterialPageRoute,
|
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||||
|
|
Loading…
Reference in a new issue