Backup before removing hiddify references
This commit is contained in:
@@ -7,6 +7,7 @@ import 'package:hiddify/core/localization/translations.dart';
|
||||
import 'package:hiddify/core/preferences/general_preferences.dart';
|
||||
import 'package:hiddify/features/auto_start/notifier/auto_start_notifier.dart';
|
||||
import 'package:hiddify/features/common/general_pref_tiles.dart';
|
||||
import 'package:hiddify/features/config_option/data/config_option_repository.dart';
|
||||
import 'package:hiddify/utils/utils.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
@@ -19,9 +20,93 @@ class GeneralSettingTiles extends HookConsumerWidget {
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
const LocalePrefTile(),
|
||||
const ThemeModePrefTile(),
|
||||
// UMBRIX: Язык и тема перенесены в левое меню
|
||||
const EnableAnalyticsPrefTile(),
|
||||
SwitchListTile(
|
||||
title: Text(t.config.blockAds),
|
||||
subtitle: Text(
|
||||
t.config.blockAdsWarning.subtitle,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
secondary: const Icon(FluentIcons.shield_prohibited_24_regular),
|
||||
value: ref.watch(ConfigOptions.blockAds),
|
||||
onChanged: (value) async {
|
||||
if (value) {
|
||||
// Показываем предупреждение при включении
|
||||
final confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
icon: const Icon(Icons.warning_amber_rounded, size: 48),
|
||||
title: Text(t.config.bypassLanWarning.title),
|
||||
content: Text(
|
||||
t.config.blockAdsWarning.message,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(t.config.bypassLanWarning.cancel),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: Text(t.config.bypassLanWarning.enable),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
if (confirmed == true) {
|
||||
ref.read(ConfigOptions.blockAds.notifier).update(true);
|
||||
}
|
||||
} else {
|
||||
ref.read(ConfigOptions.blockAds.notifier).update(false);
|
||||
}
|
||||
},
|
||||
),
|
||||
SwitchListTile(
|
||||
title: Text(t.config.bypassLan),
|
||||
subtitle: Text(
|
||||
t.config.bypassLanWarning.subtitle,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
secondary: const Icon(FluentIcons.home_24_regular),
|
||||
value: ref.watch(ConfigOptions.bypassLan),
|
||||
onChanged: (value) async {
|
||||
if (value) {
|
||||
final confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
icon: const Icon(Icons.warning_amber_rounded, size: 48),
|
||||
title: Text(t.config.bypassLanWarning.title),
|
||||
content: Text(
|
||||
t.config.bypassLanWarning.message,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(t.config.bypassLanWarning.cancel),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: Text(t.config.bypassLanWarning.enable),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
if (confirmed == true) {
|
||||
ref.read(ConfigOptions.bypassLan.notifier).update(true);
|
||||
}
|
||||
} else {
|
||||
ref.read(ConfigOptions.bypassLan.notifier).update(false);
|
||||
}
|
||||
},
|
||||
),
|
||||
SwitchListTile(
|
||||
title: Text(t.settings.general.autoIpCheck),
|
||||
secondary: const Icon(FluentIcons.globe_search_24_regular),
|
||||
|
||||
Reference in New Issue
Block a user