57 lines
1.8 KiB
Dart
57 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import 'package:hiddify/core/core_providers.dart';
|
|
import 'package:hiddify/core/prefs/prefs.dart';
|
|
import 'package:hiddify/core/router/routes/routes.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
|
class AdvancedSettingTiles extends HookConsumerWidget {
|
|
const AdvancedSettingTiles({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final t = ref.watch(translationsProvider);
|
|
|
|
final debug = ref.watch(debugModeNotifierProvider);
|
|
|
|
return Column(
|
|
children: [
|
|
ListTile(
|
|
title: Text(t.settings.config.pageTitle),
|
|
leading: const Icon(Icons.edit_document),
|
|
onTap: () async {
|
|
await const ConfigOptionsRoute().push(context);
|
|
},
|
|
),
|
|
SwitchListTile(
|
|
title: Text(t.settings.advanced.debugMode),
|
|
value: debug,
|
|
secondary: const Icon(Icons.bug_report),
|
|
onChanged: (value) async {
|
|
if (value) {
|
|
await showDialog<bool>(
|
|
context: context,
|
|
builder: (context) {
|
|
return AlertDialog(
|
|
title: Text(t.settings.advanced.debugMode),
|
|
content: Text(t.settings.advanced.debugModeMsg),
|
|
actions: [
|
|
TextButton(
|
|
onPressed: () => context.pop(true),
|
|
child: Text(
|
|
MaterialLocalizations.of(context).okButtonLabel,
|
|
),
|
|
),
|
|
],
|
|
);
|
|
},
|
|
);
|
|
}
|
|
await ref.read(debugModeNotifierProvider.notifier).update(value);
|
|
},
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|