rough ui for desktop tor settings + svgs for tor settings

This commit is contained in:
ryleedavis 2023-09-05 16:26:52 -06:00
parent fcf98d8096
commit 1dea6cdb7d
10 changed files with 217 additions and 8 deletions

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.1 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -0,0 +1,5 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="48" height="48" rx="24" fill="#E0E3E3"/>
<path d="M19.0284 34.8483C18.826 35.4564 19.1553 36.1134 19.7627 36.3159C19.884 36.3565 20.0097 36.3759 20.1306 36.3759C20.6169 36.3759 21.0689 36.0685 21.2318 35.5826L21.8017 33.8723C21.0171 33.7401 20.2679 33.5325 19.5553 33.27L19.0284 34.8483ZM28.9671 34.8483L28.4412 33.2695C27.7286 33.5322 26.9789 33.7398 26.1948 33.8718L26.7647 35.5821C26.9272 36.0665 27.3767 36.3759 27.865 36.3759C27.9858 36.3759 28.1097 36.357 28.232 36.3162C28.8414 36.1148 29.1266 35.4139 28.9671 34.8483ZM22.8376 34.0024V35.2157C22.8376 35.8586 23.3597 36.3759 23.9978 36.3759C24.6359 36.3759 25.1579 35.8562 25.1579 35.2157V34.0033C24.776 34.0362 24.3893 34.0555 23.9978 34.0555C23.6062 34.0555 23.2195 34.0362 22.8376 34.0024Z" fill="black"/>
<path d="M30.3295 18.0837C33.1429 19.7321 34.8203 22.4053 34.8203 25.2332C34.8203 30.0971 29.9622 34.0552 23.9922 34.0552C18.0222 34.0552 13.1641 30.0962 13.1641 25.2332C13.1641 22.4053 14.8439 19.7321 17.6568 18.0837C17.657 18.0836 17.6575 18.0833 17.6582 18.0828C17.7403 18.033 20.8389 16.1495 21.8067 12.2147C21.8744 11.9329 22.0951 11.7139 22.3776 11.6467C22.6532 11.5787 22.9529 11.6746 23.1414 11.8944L23.9922 12.8833L24.8449 11.8943C25.032 11.6745 25.3356 11.5785 25.6106 11.6465C25.893 11.7137 26.1135 11.9328 26.1815 12.2145C27.1555 16.1847 30.2978 18.0656 30.3295 18.0837Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -61,7 +61,7 @@ class _TorSettingsViewState extends ConsumerState<TorSettingsView> {
},
),
title: Text(
"Tor Settings",
"Tor settings",
style: STextStyles.navBarTitle(context),
),
actions: [

View file

@ -10,7 +10,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/tor_settings/tor_settings_view.dart';
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu.dart';
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/advanced_settings/advanced_settings.dart';
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/appearance_settings/appearance_settings.dart';
@ -20,6 +19,7 @@ import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/langua
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/nodes_settings.dart';
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/security_settings.dart';
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/syncing_preferences_settings.dart';
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/tor_settings/tor_settings.dart';
import 'package:stackwallet/route_generator.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/text_styles.dart';
@ -61,8 +61,8 @@ class _DesktopSettingsViewState extends ConsumerState<DesktopSettingsView> {
const Navigator(
key: Key("settingsTorDesktopKey"),
onGenerateRoute: RouteGenerator.generateRoute,
initialRoute: TorSettingsView.routeName,
), //language
initialRoute: TorSettings.routeName,
), //tor
const Navigator(
key: Key("settingsNodesDesktopKey"),
onGenerateRoute: RouteGenerator.generateRoute,

View file

@ -0,0 +1,181 @@
/*
* 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 Cypher Stack on 2023-05-26
*
*/
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
import '../../../../providers/global/prefs_provider.dart';
import '../../../../themes/stack_colors.dart';
import '../../../../widgets/custom_buttons/draggable_switch_button.dart';
class TorSettings extends ConsumerStatefulWidget {
const TorSettings({Key? key}) : super(key: key);
static const String routeName = "/torDesktopSettings";
@override
ConsumerState<TorSettings> createState() => _TorSettingsState();
}
class _TorSettingsState extends ConsumerState<TorSettings> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
final isDesktop = Util.isDesktop;
return Column(
children: [
Padding(
padding: const EdgeInsets.only(
right: 30,
),
child: RoundedWhiteContainer(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: SvgPicture.asset(
Assets.svg.circleTor,
width: 48,
height: 48,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: SvgPicture.asset(
Assets.svg.disconnectedButton,
width: 48,
height: 48,
),
),
],
),
Padding(
padding: const EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Tor settings",
style: STextStyles.desktopTextSmall(context),
),
RichText(
textAlign: TextAlign.start,
text: TextSpan(
children: [
TextSpan(
text:
"\nConnect to the Tor Network with one click.",
style: STextStyles.desktopTextExtraExtraSmall(
context),
),
TextSpan(
text: "\tWhat is Tor?",
style: STextStyles.richLink(context).copyWith(
fontSize: 14,
),
recognizer: TapGestureRecognizer()..onTap = () {},
),
],
),
),
],
),
),
const SizedBox(
height: 20,
),
SecondaryButton(
label: "Disconnect from Tor",
width: 200,
buttonHeight: ButtonHeight.m,
onPressed: () {},
),
const SizedBox(
height: 40,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
RichText(
textAlign: TextAlign.start,
text: TextSpan(
children: [
TextSpan(
text: "Tor killswitch",
style: STextStyles.desktopTextExtraExtraSmall(
context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
TextSpan(
text: "\nWhat is Tor killswitch?",
style: STextStyles.richLink(context).copyWith(
fontSize: 14,
),
recognizer: TapGestureRecognizer()
..onTap = () {},
),
],
),
),
],
),
SizedBox(
height: 20,
width: 40,
child: DraggableSwitchButton(
isOn: ref.watch(
prefsChangeNotifierProvider
.select((value) => value.torKillswitch),
),
onValueChanged: (newValue) {
ref.read(prefsChangeNotifierProvider).torKillswitch =
newValue;
},
),
),
],
),
const SizedBox(
height: 10,
),
],
),
),
),
],
);
}
}

View file

@ -167,6 +167,7 @@ import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/langua
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/nodes_settings.dart';
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/security_settings.dart';
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/syncing_preferences_settings.dart';
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/tor_settings/tor_settings.dart';
import 'package:stackwallet/services/coins/manager.dart';
import 'package:stackwallet/services/event_bus/events/global/node_connection_status_changed_event.dart';
import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart';
@ -661,6 +662,12 @@ class RouteGenerator {
builder: (_) => const TorSettingsView(),
settings: RouteSettings(name: settings.name));
case TorSettings.routeName:
return getRoute(
shouldUseMaterialRoute: useMaterialPageRoute,
builder: (_) => const TorSettings(),
settings: RouteSettings(name: settings.name));
case AboutView.routeName:
return getRoute(
shouldUseMaterialRoute: useMaterialPageRoute,

View file

@ -92,8 +92,10 @@ class _SVG {
final coinControl = const _COIN_CONTROL();
String get torConnected => "assets/svg/tor-synced.svg";
String get torConnecting => "assets/svg/tor-syncing.svg";
String get connectedButton => "assets/svg/connected-button.svg";
String get connectingButton => "assets/svg/connecting-button.svg";
String get disconnectedButton => "assets/svg/disconnected-button.svg";
String get circleTor => "assets/svg/tor-circle.svg";
String get tor => "assets/svg/tor.svg";
String get monkey => "assets/svg/monkey.svg";
String get circleSliders => "assets/svg/configuration.svg";

View file

@ -343,8 +343,10 @@ flutter:
- assets/svg/ordinal.svg
- assets/svg/monkey.svg
- assets/svg/tor.svg
- assets/svg/tor-syncing.svg
- assets/svg/tor-synced.svg
- assets/svg/tor-circle.svg
- assets/svg/connected-button.svg
- assets/svg/connecting-button.svg
- assets/svg/disconnected-button.svg
# coin control icons
- assets/svg/coin_control/