mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-01-10 11:15:49 +00:00
feat(mobile): add trobleshooting toggle (#2235)
* Added troubleshooting settings * Added asset detail info in debug mode * lint
This commit is contained in:
@@ -43,6 +43,11 @@ enum AppSettingsEnum<T> {
|
||||
"selectedAlbumSortOrder",
|
||||
0,
|
||||
),
|
||||
advancedTroubleshooting<bool>(
|
||||
StoreKey.advancedTroubleshooting,
|
||||
"advancedTroubleshooting",
|
||||
false,
|
||||
),
|
||||
;
|
||||
|
||||
const AppSettingsEnum(this.storeKey, this.hiveKey, this.defaultValue);
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/modules/settings/providers/app_settings.provider.dart';
|
||||
import 'package:immich_mobile/modules/settings/services/app_settings.service.dart';
|
||||
import 'package:immich_mobile/modules/settings/ui/settings_switch_list_tile.dart';
|
||||
|
||||
class AdvancedSettings extends HookConsumerWidget {
|
||||
const AdvancedSettings({super.key});
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final appSettingService = ref.watch(appSettingsServiceProvider);
|
||||
final isEnabled =
|
||||
useState(AppSettingsEnum.advancedTroubleshooting.defaultValue);
|
||||
|
||||
useEffect(
|
||||
() {
|
||||
isEnabled.value = appSettingService.getSetting<bool>(
|
||||
AppSettingsEnum.advancedTroubleshooting,
|
||||
);
|
||||
return null;
|
||||
},
|
||||
[],
|
||||
);
|
||||
return ExpansionTile(
|
||||
textColor: Theme.of(context).primaryColor,
|
||||
title: const Text(
|
||||
"Advanced",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
children: [
|
||||
SettingsSwitchListTile(
|
||||
enabled: true,
|
||||
appSettingService: appSettingService,
|
||||
valueNotifier: isEnabled,
|
||||
settingsEnum: AppSettingsEnum.advancedTroubleshooting,
|
||||
title: "Troubleshooting",
|
||||
subtitle: "Enable additional features for troubleshooting",
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/modules/settings/ui/advanced_settings/advanced_settings.dart';
|
||||
import 'package:immich_mobile/modules/settings/ui/asset_list_settings/asset_list_settings.dart';
|
||||
import 'package:immich_mobile/modules/settings/ui/image_viewer_quality_setting/image_viewer_quality_setting.dart';
|
||||
import 'package:immich_mobile/modules/settings/ui/notification_setting/notification_setting.dart';
|
||||
@@ -40,7 +41,8 @@ class SettingsPage extends HookConsumerWidget {
|
||||
const ThemeSetting(),
|
||||
const AssetListSettings(),
|
||||
const NotificationSetting(),
|
||||
//const ExperimentalSettings(),
|
||||
// const ExperimentalSettings(),
|
||||
const AdvancedSettings()
|
||||
],
|
||||
).toList(),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user