2023-02-23 14:49:14 +00:00
|
|
|
import 'package:auto_route/auto_route.dart';
|
2022-03-03 17:38:30 +00:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
2020-12-02 09:16:23 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:selfprivacy/config/brand_theme.dart';
|
2022-05-18 09:07:14 +00:00
|
|
|
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
2024-11-06 00:22:30 +00:00
|
|
|
import 'package:selfprivacy/ui/atoms/icons/brand_icons.dart';
|
2024-11-13 10:54:43 +00:00
|
|
|
import 'package:selfprivacy/ui/molecules/list_items/more_menu_item.dart';
|
2024-11-06 00:22:30 +00:00
|
|
|
import 'package:selfprivacy/ui/organisms/headers/brand_header.dart';
|
2023-02-23 14:49:14 +00:00
|
|
|
import 'package:selfprivacy/ui/router/router.dart';
|
2024-01-31 10:57:12 +00:00
|
|
|
import 'package:selfprivacy/utils/breakpoints.dart';
|
2020-12-06 07:46:12 +00:00
|
|
|
|
2023-03-22 11:38:18 +00:00
|
|
|
@RoutePage()
|
2020-12-02 09:16:23 +00:00
|
|
|
class MorePage extends StatelessWidget {
|
2022-10-26 16:26:09 +00:00
|
|
|
const MorePage({super.key});
|
2020-12-02 09:16:23 +00:00
|
|
|
|
|
|
|
@override
|
2022-06-05 19:36:32 +00:00
|
|
|
Widget build(final BuildContext context) {
|
|
|
|
final bool isReady = context.watch<ServerInstallationCubit>().state
|
2022-05-30 23:06:08 +00:00
|
|
|
is ServerInstallationFinished;
|
|
|
|
|
2020-12-03 16:52:53 +00:00
|
|
|
return Scaffold(
|
2023-02-23 14:49:14 +00:00
|
|
|
appBar: Breakpoints.small.isActive(context)
|
2024-05-15 16:01:27 +00:00
|
|
|
? BrandHeader(
|
|
|
|
title: 'basis.more'.tr(),
|
2023-02-23 14:49:14 +00:00
|
|
|
)
|
|
|
|
: null,
|
2020-12-03 16:52:53 +00:00
|
|
|
body: ListView(
|
|
|
|
children: [
|
|
|
|
Padding(
|
2024-11-11 01:00:33 +00:00
|
|
|
padding: paddingH16V0,
|
2020-12-03 16:52:53 +00:00
|
|
|
child: Column(
|
|
|
|
children: [
|
2022-05-30 23:06:08 +00:00
|
|
|
if (!isReady)
|
2024-11-13 10:54:43 +00:00
|
|
|
MoreMenuItem(
|
2022-10-03 23:32:35 +00:00
|
|
|
title: 'more_page.configuration_wizard'.tr(),
|
2022-05-30 23:06:08 +00:00
|
|
|
iconData: Icons.change_history_outlined,
|
2023-02-23 14:49:14 +00:00
|
|
|
goTo: () => const InitializingRoute(),
|
2022-05-30 23:06:08 +00:00
|
|
|
subtitle: 'not_ready_card.in_menu'.tr(),
|
|
|
|
accent: true,
|
|
|
|
),
|
|
|
|
if (isReady)
|
2024-11-13 10:54:43 +00:00
|
|
|
MoreMenuItem(
|
2022-10-03 23:32:35 +00:00
|
|
|
title: 'more_page.create_ssh_key'.tr(),
|
2024-11-13 10:54:43 +00:00
|
|
|
iconData: Icons.key_outlined,
|
2023-02-23 14:49:14 +00:00
|
|
|
goTo: () => UserDetailsRoute(
|
2022-09-08 15:13:18 +00:00
|
|
|
login: 'root',
|
2022-06-05 22:40:34 +00:00
|
|
|
),
|
|
|
|
),
|
2022-05-30 23:06:08 +00:00
|
|
|
if (isReady)
|
2024-11-13 10:54:43 +00:00
|
|
|
MoreMenuItem(
|
2022-05-30 23:06:08 +00:00
|
|
|
iconData: Icons.password_outlined,
|
2023-02-23 14:49:14 +00:00
|
|
|
goTo: () => const RecoveryKeyRoute(),
|
2022-05-30 23:06:08 +00:00
|
|
|
title: 'recovery_key.key_main_header'.tr(),
|
|
|
|
),
|
2022-05-31 14:30:44 +00:00
|
|
|
if (isReady)
|
2024-11-13 10:54:43 +00:00
|
|
|
MoreMenuItem(
|
2022-05-31 14:30:44 +00:00
|
|
|
iconData: Icons.devices_outlined,
|
2023-02-23 14:49:14 +00:00
|
|
|
goTo: () => const DevicesRoute(),
|
2022-05-31 14:30:44 +00:00
|
|
|
title: 'devices.main_screen.header'.tr(),
|
|
|
|
),
|
2024-11-13 10:54:43 +00:00
|
|
|
MoreMenuItem(
|
2024-07-29 22:18:54 +00:00
|
|
|
iconData: Icons.token_outlined,
|
|
|
|
title: 'tokens.title'.tr(),
|
|
|
|
goTo: () => const TokensRoute(),
|
|
|
|
),
|
2024-11-13 10:54:43 +00:00
|
|
|
MoreMenuItem(
|
2024-02-20 22:48:52 +00:00
|
|
|
title: 'application_settings.title'.tr(),
|
2022-05-30 23:06:08 +00:00
|
|
|
iconData: Icons.settings_outlined,
|
2023-02-23 14:49:14 +00:00
|
|
|
goTo: () => const AppSettingsRoute(),
|
2020-12-03 16:52:53 +00:00
|
|
|
),
|
2024-11-13 10:54:43 +00:00
|
|
|
MoreMenuItem(
|
2024-02-20 22:48:52 +00:00
|
|
|
title: 'about_application_page.title'.tr(),
|
2024-10-23 01:46:56 +00:00
|
|
|
iconData: Icons.info_outline,
|
2023-02-23 14:49:14 +00:00
|
|
|
goTo: () => const AboutApplicationRoute(),
|
|
|
|
longGoTo: const DeveloperSettingsRoute(),
|
2020-12-03 16:52:53 +00:00
|
|
|
),
|
2022-05-30 23:06:08 +00:00
|
|
|
if (!isReady)
|
2024-11-13 10:54:43 +00:00
|
|
|
MoreMenuItem(
|
2022-10-03 23:32:35 +00:00
|
|
|
title: 'more_page.onboarding'.tr(),
|
2024-10-23 01:46:56 +00:00
|
|
|
iconData: Icons.play_circle_outlined,
|
2023-02-23 14:49:14 +00:00
|
|
|
goTo: () => const OnboardingRoute(),
|
2022-05-30 23:06:08 +00:00
|
|
|
),
|
2024-11-13 10:54:43 +00:00
|
|
|
MoreMenuItem(
|
2024-02-20 22:48:52 +00:00
|
|
|
title: 'console_page.title'.tr(),
|
2021-03-18 07:26:54 +00:00
|
|
|
iconData: BrandIcons.terminal,
|
2023-02-23 14:49:14 +00:00
|
|
|
goTo: () => const ConsoleRoute(),
|
2021-01-14 21:48:05 +00:00
|
|
|
),
|
2020-12-03 16:52:53 +00:00
|
|
|
],
|
|
|
|
),
|
2023-11-06 13:15:38 +00:00
|
|
|
),
|
2020-12-03 16:52:53 +00:00
|
|
|
],
|
|
|
|
),
|
2020-12-02 09:16:23 +00:00
|
|
|
);
|
|
|
|
}
|
2021-09-02 19:32:07 +00:00
|
|
|
}
|