2023-05-26 21:21:16 +00:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-10-06 18:20:24 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
2022-12-01 16:10:18 +00:00
|
|
|
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu.dart';
|
2022-12-01 14:48:23 +00:00
|
|
|
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/advanced_settings/advanced_settings.dart';
|
2023-05-12 15:32:35 +00:00
|
|
|
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/appearance_settings/appearance_settings.dart';
|
2022-12-01 14:48:23 +00:00
|
|
|
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/backup_and_restore/backup_and_restore_settings.dart';
|
|
|
|
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/currency_settings/currency_settings.dart';
|
|
|
|
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/language_settings/language_settings.dart';
|
|
|
|
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';
|
2023-09-05 22:26:52 +00:00
|
|
|
import 'package:stackwallet/pages_desktop_specific/settings/settings_menu/tor_settings/tor_settings.dart';
|
2022-10-17 15:07:17 +00:00
|
|
|
import 'package:stackwallet/route_generator.dart';
|
2023-05-09 21:57:40 +00:00
|
|
|
import 'package:stackwallet/themes/stack_colors.dart';
|
2022-10-17 16:50:37 +00:00
|
|
|
import 'package:stackwallet/utilities/text_styles.dart';
|
|
|
|
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
|
|
|
|
import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
|
2022-10-06 18:20:24 +00:00
|
|
|
|
|
|
|
class DesktopSettingsView extends ConsumerStatefulWidget {
|
|
|
|
const DesktopSettingsView({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
static const String routeName = "/desktopSettings";
|
|
|
|
|
|
|
|
@override
|
|
|
|
ConsumerState<DesktopSettingsView> createState() =>
|
|
|
|
_DesktopSettingsViewState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _DesktopSettingsViewState extends ConsumerState<DesktopSettingsView> {
|
|
|
|
final List<Widget> contentViews = [
|
2022-10-17 15:07:17 +00:00
|
|
|
const Navigator(
|
2022-10-17 16:10:16 +00:00
|
|
|
key: Key("settingsBackupRestoreDesktopKey"),
|
2022-10-17 15:07:17 +00:00
|
|
|
onGenerateRoute: RouteGenerator.generateRoute,
|
2022-10-19 22:12:25 +00:00
|
|
|
initialRoute: BackupRestoreSettings.routeName,
|
2022-10-06 18:20:24 +00:00
|
|
|
), //b+r
|
2022-10-19 22:12:25 +00:00
|
|
|
const Navigator(
|
|
|
|
key: Key("settingsSecurityDesktopKey"),
|
|
|
|
onGenerateRoute: RouteGenerator.generateRoute,
|
|
|
|
initialRoute: SecuritySettings.routeName,
|
2022-10-06 18:20:24 +00:00
|
|
|
), //security
|
2022-10-19 22:12:25 +00:00
|
|
|
const Navigator(
|
|
|
|
key: Key("settingsCurrencyDesktopKey"),
|
|
|
|
onGenerateRoute: RouteGenerator.generateRoute,
|
|
|
|
initialRoute: CurrencySettings.routeName,
|
2022-10-06 18:20:24 +00:00
|
|
|
), //currency
|
2022-10-19 22:12:25 +00:00
|
|
|
const Navigator(
|
2022-10-20 17:54:24 +00:00
|
|
|
key: Key("settingsLanguageDesktopKey"),
|
2022-10-19 22:12:25 +00:00
|
|
|
onGenerateRoute: RouteGenerator.generateRoute,
|
|
|
|
initialRoute: LanguageOptionSettings.routeName,
|
2023-09-05 19:39:57 +00:00
|
|
|
),
|
|
|
|
const Navigator(
|
|
|
|
key: Key("settingsTorDesktopKey"),
|
|
|
|
onGenerateRoute: RouteGenerator.generateRoute,
|
2023-09-05 22:26:52 +00:00
|
|
|
initialRoute: TorSettings.routeName,
|
|
|
|
), //tor
|
2022-10-20 17:54:24 +00:00
|
|
|
const Navigator(
|
|
|
|
key: Key("settingsNodesDesktopKey"),
|
|
|
|
onGenerateRoute: RouteGenerator.generateRoute,
|
|
|
|
initialRoute: NodesSettings.routeName,
|
2022-10-06 18:20:24 +00:00
|
|
|
), //nodes
|
2022-10-19 22:12:25 +00:00
|
|
|
const Navigator(
|
|
|
|
key: Key("settingsSyncingPreferencesDesktopKey"),
|
|
|
|
onGenerateRoute: RouteGenerator.generateRoute,
|
|
|
|
initialRoute: SyncingPreferencesSettings.routeName,
|
2022-10-06 18:20:24 +00:00
|
|
|
), //syncing prefs
|
2022-10-19 22:12:25 +00:00
|
|
|
const Navigator(
|
|
|
|
key: Key("settingsAppearanceDesktopKey"),
|
|
|
|
onGenerateRoute: RouteGenerator.generateRoute,
|
|
|
|
initialRoute: AppearanceOptionSettings.routeName,
|
2022-10-06 18:20:24 +00:00
|
|
|
), //appearance
|
2022-10-19 22:12:25 +00:00
|
|
|
const Navigator(
|
|
|
|
key: Key("settingsAdvancedDesktopKey"),
|
|
|
|
onGenerateRoute: RouteGenerator.generateRoute,
|
|
|
|
initialRoute: AdvancedSettings.routeName,
|
2022-10-06 18:20:24 +00:00
|
|
|
), //advanced
|
|
|
|
];
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-10-17 16:50:37 +00:00
|
|
|
return DesktopScaffold(
|
|
|
|
background: Theme.of(context).extension<StackColors>()!.background,
|
2023-06-21 18:47:47 +00:00
|
|
|
appBar: const DesktopAppBar(
|
2022-10-17 16:50:37 +00:00
|
|
|
isCompactHeight: true,
|
|
|
|
leading: Row(
|
2023-06-21 18:47:47 +00:00
|
|
|
children: [
|
2022-12-01 16:10:18 +00:00
|
|
|
SizedBox(
|
2022-10-17 16:50:37 +00:00
|
|
|
width: 24,
|
|
|
|
height: 24,
|
|
|
|
),
|
2022-12-01 16:10:18 +00:00
|
|
|
DesktopSettingsTitle(),
|
2022-10-17 16:50:37 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
body: Row(
|
2022-10-06 18:20:24 +00:00
|
|
|
children: [
|
2023-06-21 18:47:47 +00:00
|
|
|
const Padding(
|
|
|
|
padding: EdgeInsets.all(15.0),
|
2024-01-31 22:18:52 +00:00
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: SettingsMenu(),
|
|
|
|
),
|
|
|
|
),
|
2023-06-21 18:47:47 +00:00
|
|
|
),
|
2022-10-06 18:20:24 +00:00
|
|
|
Expanded(
|
2022-12-01 16:10:18 +00:00
|
|
|
child: contentViews[
|
|
|
|
ref.watch(selectedSettingsMenuItemStateProvider.state).state],
|
2022-10-06 18:20:24 +00:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2022-12-01 16:10:18 +00:00
|
|
|
|
|
|
|
class DesktopSettingsTitle extends StatelessWidget {
|
|
|
|
const DesktopSettingsTitle({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Text(
|
|
|
|
"Settings",
|
|
|
|
style: STextStyles.desktopH3(context),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|