Backup before removing hiddify references

This commit is contained in:
Hiddify User
2026-01-15 12:28:40 +03:00
parent f54603d129
commit 36d9e31236
231 changed files with 6648 additions and 1832 deletions

View File

@@ -5,13 +5,105 @@ import 'package:hiddify/core/localization/translations.dart';
import 'package:hiddify/core/router/router.dart';
import 'package:hiddify/features/config_option/data/config_option_repository.dart';
import 'package:hiddify/features/config_option/notifier/warp_option_notifier.dart';
import 'package:hiddify/features/config_option/overview/config_options_page.dart';
import 'package:hiddify/features/settings/experimental_features_page.dart';
import 'package:hiddify/singbox/model/singbox_config_enum.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
class QuickSettingsModal extends HookConsumerWidget {
const QuickSettingsModal({super.key});
void _showHelpDialog(BuildContext context, Translations t) {
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Row(
children: [
const Icon(FluentIcons.info_24_regular, size: 28),
const SizedBox(width: 12),
Expanded(child: Text(t.config.quickSettings)),
],
),
content: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildHelpSection(
icon: FluentIcons.server_20_filled,
title: 'Прокси / VPN',
description: 'Выберите режим подключения:\n\n'
'• Прокси — использует локальный прокси-сервер для перенаправления трафика приложений\n'
'• VPN — создает виртуальную частную сеть для защиты всего трафика устройства',
),
const Divider(height: 24),
_buildHelpSection(
icon: FluentIcons.shield_20_filled,
title: t.config.setupWarp,
description: 'Технология Cloudflare WARP для дополнительной защиты:\n\n'
'• Шифрует DNS-запросы\n'
'• Скрывает ваш IP-адрес\n'
'• Улучшает скорость подключения в некоторых регионах\n'
'• Требует первоначальной настройки с получением лицензионного ключа',
),
const Divider(height: 24),
_buildHelpSection(
icon: FluentIcons.shield_keyhole_20_filled,
title: t.config.enableTlsFragment,
description: 'Разбивает TLS-пакеты на фрагменты для обхода блокировок:\n\n'
'• Помогает обойти DPI (глубокую проверку пакетов)\n'
'• Работает на уровне TLS-рукопожатия\n'
'• Может немного замедлить начальное соединение\n'
'• Эффективно против систем блокировки на основе анализа SNI',
),
],
),
),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: Text(t.window.close),
),
],
),
);
}
Widget _buildHelpSection({
required IconData icon,
required String title,
required String description,
}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(icon, size: 20),
const SizedBox(width: 8),
Expanded(
child: Text(
title,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
),
],
),
const SizedBox(height: 8),
Text(
description,
style: TextStyle(
fontSize: 14,
color: Colors.grey[600],
height: 1.4,
),
),
],
);
}
@override
Widget build(BuildContext context, WidgetRef ref) {
final t = ref.watch(translationsProvider);
@@ -21,6 +113,28 @@ class QuickSettingsModal extends HookConsumerWidget {
return SingleChildScrollView(
child: Column(
children: [
// Заголовок с кнопкой помощи
Padding(
padding: const EdgeInsets.fromLTRB(16, 8, 8, 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
t.config.quickSettings,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
IconButton(
icon: const Icon(FluentIcons.question_circle_24_regular),
onPressed: () => _showHelpDialog(context, t),
tooltip: 'Справка',
),
],
),
),
const Gap(8),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: SegmentedButton(
@@ -42,31 +156,25 @@ class QuickSettingsModal extends HookConsumerWidget {
),
const Gap(8),
if (warpPrefaceCompleted)
GestureDetector(
onLongPress: () {
ConfigOptionsRoute(section: ConfigOptionSection.warp.name).go(context);
},
child: SwitchListTile(
value: ref.watch(ConfigOptions.enableWarp),
onChanged: ref.watch(ConfigOptions.enableWarp.notifier).update,
title: Text(t.config.enableWarp),
),
SwitchListTile(
value: ref.watch(ConfigOptions.enableWarp),
onChanged: ref.watch(ConfigOptions.enableWarp.notifier).update,
title: Text(t.config.enableWarp),
)
else
ListTile(
title: Text(t.config.setupWarp),
trailing: const Icon(FluentIcons.chevron_right_24_regular),
onTap: () => ConfigOptionsRoute(section: ConfigOptionSection.warp.name).go(context),
),
GestureDetector(
onLongPress: () {
ConfigOptionsRoute(section: ConfigOptionSection.fragment.name).go(context);
},
child: SwitchListTile(
value: ref.watch(ConfigOptions.enableTlsFragment),
onChanged: ref.watch(ConfigOptions.enableTlsFragment.notifier).update,
title: Text(t.config.enableTlsFragment),
onTap: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const ExperimentalFeaturesPage(),
),
),
),
SwitchListTile(
value: ref.watch(ConfigOptions.enableTlsFragment),
onChanged: ref.watch(ConfigOptions.enableTlsFragment.notifier).update,
title: Text(t.config.enableTlsFragment),
),
// SwitchListTile(
// value: ref.watch(ConfigOptions.enableMux),