mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-08-25 22:41:51 +00:00
101 lines
3.8 KiB
Dart
101 lines
3.8 KiB
Dart
import 'package:auto_route/auto_route.dart';
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:selfprivacy/config/get_it_config.dart';
|
|
import 'package:selfprivacy/logic/api_maps/tls_options.dart';
|
|
import 'package:selfprivacy/logic/cubit/app_settings/app_settings_cubit.dart';
|
|
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
|
|
|
@RoutePage()
|
|
class DeveloperSettingsPage extends StatefulWidget {
|
|
const DeveloperSettingsPage({super.key});
|
|
|
|
@override
|
|
State<DeveloperSettingsPage> createState() => _DeveloperSettingsPageState();
|
|
}
|
|
|
|
class _DeveloperSettingsPageState extends State<DeveloperSettingsPage> {
|
|
@override
|
|
Widget build(final BuildContext context) => BrandHeroScreen(
|
|
hasBackButton: true,
|
|
hasFlashButton: false,
|
|
bodyPadding: const EdgeInsets.symmetric(vertical: 16),
|
|
heroTitle: 'developer_settings.title'.tr(),
|
|
heroSubtitle: 'developer_settings.subtitle'.tr(),
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Text(
|
|
'developer_settings.server_setup'.tr(),
|
|
style: Theme.of(context).textTheme.labelLarge!.copyWith(
|
|
color: Theme.of(context).colorScheme.secondary,
|
|
),
|
|
),
|
|
),
|
|
SwitchListTile(
|
|
title: Text('developer_settings.use_staging_acme'.tr()),
|
|
subtitle:
|
|
Text('developer_settings.use_staging_acme_description'.tr()),
|
|
value: TlsOptions.stagingAcme,
|
|
onChanged: (final bool value) => setState(
|
|
() => TlsOptions.stagingAcme = value,
|
|
),
|
|
),
|
|
SwitchListTile(
|
|
title: Text('developer_settings.ignore_tls'.tr()),
|
|
subtitle: Text('developer_settings.ignore_tls_description'.tr()),
|
|
value: TlsOptions.verifyCertificate,
|
|
onChanged: (final bool value) => setState(
|
|
() => TlsOptions.verifyCertificate = value,
|
|
),
|
|
),
|
|
SwitchListTile(
|
|
title: Text('developer_settings.allow_ssh_key_at_setup'.tr()),
|
|
subtitle: Text(
|
|
'developer_settings.allow_ssh_key_at_setup_description'.tr(),
|
|
),
|
|
value: TlsOptions.allowCustomSshKeyDuringSetup,
|
|
onChanged: (final bool value) => setState(
|
|
() => TlsOptions.allowCustomSshKeyDuringSetup = value,
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Text(
|
|
'developer_settings.routing'.tr(),
|
|
style: Theme.of(context).textTheme.labelLarge!.copyWith(
|
|
color: Theme.of(context).colorScheme.secondary,
|
|
),
|
|
),
|
|
),
|
|
ListTile(
|
|
title: Text('developer_settings.reset_onboarding'.tr()),
|
|
subtitle:
|
|
Text('developer_settings.reset_onboarding_description'.tr()),
|
|
enabled:
|
|
!context.watch<AppSettingsCubit>().state.isOnboardingShowing,
|
|
onTap: () => context
|
|
.read<AppSettingsCubit>()
|
|
.turnOffOnboarding(isOnboardingShowing: true),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Text(
|
|
'developer_settings.cubit_statuses'.tr(),
|
|
style: Theme.of(context).textTheme.labelLarge!.copyWith(
|
|
color: Theme.of(context).colorScheme.secondary,
|
|
),
|
|
),
|
|
),
|
|
ListTile(
|
|
title: const Text('ApiConnectionRepository status'),
|
|
subtitle: Text(
|
|
getIt<ApiConnectionRepository>()
|
|
.currentConnectionStatus
|
|
.toString(),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|