stack_wallet/lib/pages_desktop_specific/home/desktop_settings_view.dart

90 lines
2.4 KiB
Dart
Raw Normal View History

2022-10-06 18:20:24 +00:00
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
2022-10-17 15:07:17 +00:00
import 'package:stackwallet/pages_desktop_specific/home/settings_menu/backup_and_restore.dart';
2022-10-06 18:20:24 +00:00
import 'package:stackwallet/pages_desktop_specific/home/settings_menu/settings_menu.dart';
2022-10-17 15:07:17 +00:00
import 'package:stackwallet/route_generator.dart';
2022-10-17 16:50:37 +00:00
import 'package:stackwallet/utilities/text_styles.dart';
2022-10-06 18:20:24 +00:00
import 'package:stackwallet/utilities/theme/stack_colors.dart';
2022-10-17 16:50:37 +00:00
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> {
int currentViewIndex = 0;
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,
initialRoute: BackupRestore.routeName,
2022-10-06 18:20:24 +00:00
), //b+r
Container(
color: Colors.green,
), //security
Container(
color: Colors.red,
), //currency
Container(
color: Colors.orange,
), //language
Container(
color: Colors.yellow,
), //nodes
Container(
color: Colors.blue,
), //syncing prefs
Container(
color: Colors.pink,
), //appearance
Container(
color: Colors.purple,
), //advanced
];
void onMenuSelectionChanged(int newIndex) {
setState(() {
currentViewIndex = newIndex;
});
}
@override
Widget build(BuildContext context) {
2022-10-17 16:50:37 +00:00
return DesktopScaffold(
background: Theme.of(context).extension<StackColors>()!.background,
appBar: DesktopAppBar(
isCompactHeight: true,
leading: Row(
children: [
const SizedBox(
width: 24,
height: 24,
),
Text(
"Settings",
style: STextStyles.desktopH3(context),
)
],
),
),
body: Row(
2022-10-06 18:20:24 +00:00
children: [
SettingsMenu(
onSelectionChanged: onMenuSelectionChanged,
),
Expanded(
child: contentViews[currentViewIndex],
),
],
),
);
}
}