89 lines
3.4 KiB
Dart
89 lines
3.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
|
import 'package:gap/gap.dart';
|
|
import 'package:hiddify/core/localization/translations.dart';
|
|
import 'package:hiddify/core/router/routes.dart';
|
|
import 'package:hiddify/features/common/nested_app_bar.dart';
|
|
import 'package:hiddify/features/settings/experimental_features_page.dart';
|
|
import 'package:hiddify/features/settings/widgets/widgets.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
|
class SettingsOverviewPage extends HookConsumerWidget {
|
|
const SettingsOverviewPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final t = ref.watch(translationsProvider);
|
|
|
|
return Scaffold(
|
|
body: CustomScrollView(
|
|
slivers: [
|
|
NestedAppBar(
|
|
title: Text(t.settings.pageTitle),
|
|
),
|
|
SliverList.list(
|
|
children: [
|
|
SettingsSection(t.settings.general.sectionTitle),
|
|
const GeneralSettingTiles(),
|
|
const PlatformSettingsTiles(),
|
|
const SettingsDivider(),
|
|
// Расширенные - раскрывающаяся секция
|
|
Theme(
|
|
data: Theme.of(context).copyWith(dividerColor: Colors.transparent),
|
|
child: ExpansionTile(
|
|
leading: const Icon(Icons.tune),
|
|
title: Text(t.settings.advanced.sectionTitle),
|
|
initiallyExpanded: false,
|
|
children: const [
|
|
AdvancedSettingTiles(),
|
|
],
|
|
),
|
|
),
|
|
const SettingsDivider(),
|
|
// Экспериментальные - обычная кнопка
|
|
ListTile(
|
|
leading: const Icon(Icons.science_outlined),
|
|
title: Text(t.settings.experimental),
|
|
subtitle: Text(t.settings.experimentalMsg),
|
|
trailing: const Icon(Icons.arrow_forward_ios),
|
|
onTap: () {
|
|
Navigator.of(context).push(
|
|
MaterialPageRoute(
|
|
builder: (context) => const ExperimentalFeaturesPage(),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
const SettingsDivider(),
|
|
// Параметры конфигурации - обычная кнопка
|
|
ListTile(
|
|
leading: const Icon(FluentIcons.box_edit_20_filled),
|
|
title: Text(t.config.pageTitle),
|
|
subtitle: Text(t.config.allOptions),
|
|
trailing: const Icon(Icons.arrow_forward_ios),
|
|
onTap: () {
|
|
const ConfigOptionsRoute().push(context);
|
|
},
|
|
),
|
|
const SettingsDivider(),
|
|
// Логи - раскрывающаяся секция
|
|
Theme(
|
|
data: Theme.of(context).copyWith(dividerColor: Colors.transparent),
|
|
child: ExpansionTile(
|
|
leading: const Icon(FluentIcons.document_text_20_filled),
|
|
title: Text(t.logs.pageTitle),
|
|
initiallyExpanded: false,
|
|
children: const [
|
|
LogsSettingTiles(),
|
|
],
|
|
),
|
|
),
|
|
const Gap(16),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|