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-12-01 16:10:18 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import 'package:flutter_svg/svg.dart';
|
2024-05-23 00:37:06 +00:00
|
|
|
import 'settings_menu_item.dart';
|
|
|
|
import '../../themes/stack_colors.dart';
|
|
|
|
import '../../utilities/assets.dart';
|
2022-12-01 16:10:18 +00:00
|
|
|
|
|
|
|
final selectedSettingsMenuItemStateProvider = StateProvider<int>((_) => 0);
|
|
|
|
|
|
|
|
class SettingsMenu extends ConsumerStatefulWidget {
|
|
|
|
const SettingsMenu({
|
|
|
|
Key? key,
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
ConsumerState<ConsumerStatefulWidget> createState() => _SettingsMenuState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _SettingsMenuState extends ConsumerState<SettingsMenu> {
|
|
|
|
final List<String> labels = [
|
|
|
|
"Backup and restore",
|
|
|
|
"Security",
|
|
|
|
"Currency",
|
|
|
|
"Language",
|
2023-09-05 19:39:57 +00:00
|
|
|
"Tor settings",
|
2022-12-01 16:10:18 +00:00
|
|
|
"Nodes",
|
|
|
|
"Syncing preferences",
|
|
|
|
"Appearance",
|
|
|
|
"Advanced",
|
|
|
|
];
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
debugPrint("BUILD: $runtimeType");
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
2023-06-21 18:47:47 +00:00
|
|
|
SizedBox(
|
|
|
|
width: 250,
|
2022-12-01 16:10:18 +00:00
|
|
|
child: Column(
|
2023-06-21 18:47:47 +00:00
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
2022-12-01 16:10:18 +00:00
|
|
|
children: [
|
|
|
|
for (int i = 0; i < labels.length; i++)
|
|
|
|
Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
if (i > 0)
|
|
|
|
const SizedBox(
|
|
|
|
height: 2,
|
|
|
|
),
|
|
|
|
SettingsMenuItem<int>(
|
|
|
|
icon: SvgPicture.asset(
|
|
|
|
Assets.svg.polygon,
|
|
|
|
width: 11,
|
|
|
|
height: 11,
|
|
|
|
color: ref
|
|
|
|
.watch(selectedSettingsMenuItemStateProvider
|
|
|
|
.state)
|
|
|
|
.state ==
|
|
|
|
i
|
|
|
|
? Theme.of(context)
|
|
|
|
.extension<StackColors>()!
|
|
|
|
.accentColorBlue
|
|
|
|
: Colors.transparent,
|
|
|
|
),
|
|
|
|
label: labels[i],
|
|
|
|
value: i,
|
|
|
|
group: ref
|
|
|
|
.watch(selectedSettingsMenuItemStateProvider.state)
|
|
|
|
.state,
|
|
|
|
onChanged: (newValue) => ref
|
|
|
|
.read(selectedSettingsMenuItemStateProvider.state)
|
|
|
|
.state = newValue,
|
|
|
|
),
|
|
|
|
],
|
2023-06-21 18:47:47 +00:00
|
|
|
),
|
2022-12-01 16:10:18 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|