diff --git a/assets/markdown/about-be.md b/assets/markdown/about-be.md deleted file mode 100644 index 71a9ef3e..00000000 --- a/assets/markdown/about-be.md +++ /dev/null @@ -1,12 +0,0 @@ -### Пра нас - -Усё больш арганізацый жадаюць валодаць нашымі дадзенымі -Праект дазваляе толькі Вам у поўнай меры распараджацца ўласнымі **дадзенымі** на сваім сэрвэры. - -### Наша місія - -Лічбавая незалежнасць і прыватнасць, даступныя кожнаму - -### Мэта - -Распрацаваць праграму, якая дазволіць кожнаму разгарнуць свае прыватныя паслугі для сябе і сваіх суседзяў. \ No newline at end of file diff --git a/assets/markdown/about-cs.md b/assets/markdown/about-cs.md deleted file mode 100644 index 4d0a01e2..00000000 --- a/assets/markdown/about-cs.md +++ /dev/null @@ -1,12 +0,0 @@ -### O nás - -More and more corporations want to control our data. -We want to have full control of our **data** on our own. - -### Naše poslání - -Digitální nezávislost a soukromí dostupné všem - -### Cíl - -Rozvíjet program, který umožní každému nasadit své soukromé služby pro sebe a své sousedy. \ No newline at end of file diff --git a/assets/markdown/about-de.md b/assets/markdown/about-de.md deleted file mode 100644 index 401af514..00000000 --- a/assets/markdown/about-de.md +++ /dev/null @@ -1,12 +0,0 @@ -### Über uns - -Immer mehr Unternehmen wollen unsere Daten kontrollieren. -Wir wollen selbst die volle Kontrolle über unsere **data** haben. - -### Unsere Mission - -Digitale Unabhängigkeit und Privatsphäre für alle verfügbar - -### Ziel - -Das Programm entwickeln, das es jedem ermöglicht, seine privaten Dienste für sich und seine Nachbarn einzusetzen. \ No newline at end of file diff --git a/assets/markdown/about-en.md b/assets/markdown/about-en.md deleted file mode 100644 index 3963aa6e..00000000 --- a/assets/markdown/about-en.md +++ /dev/null @@ -1,12 +0,0 @@ -### About us - -More and more corporations want to control our data. -We want to have full control of our **data** on our own. - -### Our mission - -Digital independence and privacy, available to everyone - -### Target - -Develop the program, which will allow everyone to deploy their private services for themselves and their neighbours. \ No newline at end of file diff --git a/assets/markdown/about-es.md b/assets/markdown/about-es.md deleted file mode 100644 index 3963aa6e..00000000 --- a/assets/markdown/about-es.md +++ /dev/null @@ -1,12 +0,0 @@ -### About us - -More and more corporations want to control our data. -We want to have full control of our **data** on our own. - -### Our mission - -Digital independence and privacy, available to everyone - -### Target - -Develop the program, which will allow everyone to deploy their private services for themselves and their neighbours. \ No newline at end of file diff --git a/assets/markdown/about-fr.md b/assets/markdown/about-fr.md deleted file mode 100644 index 3963aa6e..00000000 --- a/assets/markdown/about-fr.md +++ /dev/null @@ -1,12 +0,0 @@ -### About us - -More and more corporations want to control our data. -We want to have full control of our **data** on our own. - -### Our mission - -Digital independence and privacy, available to everyone - -### Target - -Develop the program, which will allow everyone to deploy their private services for themselves and their neighbours. \ No newline at end of file diff --git a/assets/markdown/about-it.md b/assets/markdown/about-it.md deleted file mode 100644 index 3963aa6e..00000000 --- a/assets/markdown/about-it.md +++ /dev/null @@ -1,12 +0,0 @@ -### About us - -More and more corporations want to control our data. -We want to have full control of our **data** on our own. - -### Our mission - -Digital independence and privacy, available to everyone - -### Target - -Develop the program, which will allow everyone to deploy their private services for themselves and their neighbours. \ No newline at end of file diff --git a/assets/markdown/about-ja.md b/assets/markdown/about-ja.md deleted file mode 100644 index 3963aa6e..00000000 --- a/assets/markdown/about-ja.md +++ /dev/null @@ -1,12 +0,0 @@ -### About us - -More and more corporations want to control our data. -We want to have full control of our **data** on our own. - -### Our mission - -Digital independence and privacy, available to everyone - -### Target - -Develop the program, which will allow everyone to deploy their private services for themselves and their neighbours. \ No newline at end of file diff --git a/assets/markdown/about-ka.md b/assets/markdown/about-ka.md deleted file mode 100644 index 3963aa6e..00000000 --- a/assets/markdown/about-ka.md +++ /dev/null @@ -1,12 +0,0 @@ -### About us - -More and more corporations want to control our data. -We want to have full control of our **data** on our own. - -### Our mission - -Digital independence and privacy, available to everyone - -### Target - -Develop the program, which will allow everyone to deploy their private services for themselves and their neighbours. \ No newline at end of file diff --git a/assets/markdown/about-nl.md b/assets/markdown/about-nl.md deleted file mode 100644 index 3963aa6e..00000000 --- a/assets/markdown/about-nl.md +++ /dev/null @@ -1,12 +0,0 @@ -### About us - -More and more corporations want to control our data. -We want to have full control of our **data** on our own. - -### Our mission - -Digital independence and privacy, available to everyone - -### Target - -Develop the program, which will allow everyone to deploy their private services for themselves and their neighbours. \ No newline at end of file diff --git a/assets/markdown/about-pl.md b/assets/markdown/about-pl.md deleted file mode 100644 index ebd41246..00000000 --- a/assets/markdown/about-pl.md +++ /dev/null @@ -1,12 +0,0 @@ -### About us - -More and more corporations want to control our data. -We want to have full control of our **data** on our own. - -### Misja projektu - -Niezależność i prywatność cyfrowa dostępna dla wszystkich - -### Cel - -Opracuj program, dzięki któremu każdy będzie mógł stworzyć prywatne usługi dla siebie i swoich bliskich. \ No newline at end of file diff --git a/assets/markdown/about-ru.md b/assets/markdown/about-ru.md deleted file mode 100644 index 15c0f237..00000000 --- a/assets/markdown/about-ru.md +++ /dev/null @@ -1,12 +0,0 @@ -### О проекте - -Всё больше организаций хотят владеть нашими данными -Проект позволяет только Вам в полной мере распоряжаться собственными **данными** на своём сервере. - -### Миссия проекта - -Цифровая независимость и приватность, доступная каждому - -### Цель - -Развивать программу, которая позволит каждому создавать приватные сервисы для себя и своих близких. \ No newline at end of file diff --git a/assets/markdown/about-sk.md b/assets/markdown/about-sk.md deleted file mode 100644 index d3135d3b..00000000 --- a/assets/markdown/about-sk.md +++ /dev/null @@ -1,12 +0,0 @@ -### O nás - -More and more corporations want to control our data. -We want to have full control of our **data** on our own. - -### Naše poslanie - -Digitálna nezávislosť a súkromie dostupné pre každého - -### Cieľ - -Vytvorte program, ktorý umožní každému vytvoriť súkromné služby pre seba a svojich blízkych. \ No newline at end of file diff --git a/assets/markdown/about-th.md b/assets/markdown/about-th.md deleted file mode 100644 index 3963aa6e..00000000 --- a/assets/markdown/about-th.md +++ /dev/null @@ -1,12 +0,0 @@ -### About us - -More and more corporations want to control our data. -We want to have full control of our **data** on our own. - -### Our mission - -Digital independence and privacy, available to everyone - -### Target - -Develop the program, which will allow everyone to deploy their private services for themselves and their neighbours. \ No newline at end of file diff --git a/assets/markdown/about-uk.md b/assets/markdown/about-uk.md deleted file mode 100644 index fee81d64..00000000 --- a/assets/markdown/about-uk.md +++ /dev/null @@ -1,12 +0,0 @@ -### Про нас - -Все більше корпорацій хочуть контролювати свої дані. -Ми хочемо мати повний контроль над нашими. - -### Наша місія - -Цифрова незалежність і конфіденційність доступні кожному - -### Ціль - -Розробити програму, яка дозволить кожному розгорнути свої приватні послуги для себе та їх сусідів. \ No newline at end of file diff --git a/assets/translations/en.json b/assets/translations/en.json index b89dbc58..2e75f9cd 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -41,25 +41,36 @@ }, "more_page": { "configuration_wizard": "Setup wizard", - "about_project": "About us", - "about_application": "About", "onboarding": "Onboarding", - "create_ssh_key": "Superuser SSH keys", - "console": "Console", - "application_settings": "Application settings" + "create_ssh_key": "Superuser SSH keys" }, "console_page": { "title": "Console", "waiting": "Waiting for initialization…", "copy": "Copy" }, - "about_us_page": { - "title": "About us" - }, "about_application_page": { - "title": "About", - "application_version_text": "Application version {}", - "api_version_text": "Server API version {}", + "title": "About & support", + "versions": "Versions", + "application_version_text": "Application version", + "api_version_text": "Server API version", + "open_source_licenses": "Open source licenses", + "links": "Links", + "website": "Our website", + "documentation": "Documentation", + "matrix_channel": "Matrix channel", + "telegram_channel": "Telegram channel", + "get_support": "Get support", + "matrix_support_chat": "Matrix support chat", + "telegram_support_chat": "Telegram support chat", + "email_support": "Email support", + "contribute": "Contribute", + "source_code": "Source code", + "bug_report": "Report a bug", + "bug_report_subtitle": "Due to spam, manual account confirmation is required. Contact us in the support chat to activate your account.", + "help_translate": "Help us translate", + "matrix_contributors_chat": "Matrix contributors chat", + "telegram_contributors_chat": "Telegram contributors chat", "privacy_policy": "Privacy policy" }, "application_settings": { diff --git a/lib/illustrations/stray_deer.dart b/lib/illustrations/stray_deer.dart index 88fd55c3..e7554827 100644 --- a/lib/illustrations/stray_deer.dart +++ b/lib/illustrations/stray_deer.dart @@ -17,10 +17,6 @@ class StrayDeerPainter extends CustomPainter { final Color deerSkin = const Color(0xffe0ac9c).harmonizeWith(colorScheme.primary); - print('deerSkin: $deerSkin'); - print('colorScheme.primary: ${colorScheme.primary}'); - print('colorPalette.tertiary.get(10): ${colorPalette.tertiary.get(50)}'); - final Path path0 = Path(); path0.moveTo(size.width * 0.6099773, size.height * 0.6719577); path0.lineTo(size.width * 0.6088435, size.height * 0.6719577); diff --git a/lib/ui/pages/more/about_application.dart b/lib/ui/pages/more/about_application.dart index 5ec4b9be..b652b8af 100644 --- a/lib/ui/pages/more/about_application.dart +++ b/lib/ui/pages/more/about_application.dart @@ -1,11 +1,13 @@ +import 'dart:io'; + import 'package:auto_route/auto_route.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:package_info/package_info.dart'; -import 'package:selfprivacy/logic/api_maps/graphql_maps/server_api/server_api.dart'; -import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart'; -import 'package:selfprivacy/ui/components/brand_md/brand_md.dart'; +import 'package:selfprivacy/config/get_it_config.dart'; import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart'; +import 'package:selfprivacy/utils/breakpoints.dart'; +import 'package:selfprivacy/utils/platform_adapter.dart'; import 'package:url_launcher/url_launcher.dart'; @RoutePage() @@ -14,56 +16,185 @@ class AboutApplicationPage extends StatelessWidget { @override Widget build(final BuildContext context) { - final bool isReady = context.watch().state - is ServerInstallationFinished; + IconData getPlatformIcon() { + if (Platform.isAndroid) { + if (Breakpoints.small.isActive(context)) { + return Icons.phone_android_outlined; + } + return Icons.tablet_android_outlined; + } else if (Platform.isIOS) { + if (Breakpoints.small.isActive(context)) { + return Icons.phone_iphone_outlined; + } + return Icons.tablet_mac_outlined; + } else if (Platform.isWindows || Platform.isLinux) { + return Icons.desktop_windows_outlined; + } else if (Platform.isMacOS) { + return Icons.desktop_mac_outlined; + } else { + return Icons.devices_other_outlined; + } + } + + final deviceIcon = getPlatformIcon(); return BrandHeroScreen( hasBackButton: true, hasFlashButton: false, heroTitle: 'about_application_page.title'.tr(), + bodyPadding: const EdgeInsets.symmetric(vertical: 16), children: [ + SectionTitle(title: 'about_application_page.versions'.tr()), FutureBuilder( future: _packageVersion(), - builder: (final context, final snapshot) => Text( - 'about_application_page.application_version_text' - .tr(args: [snapshot.data.toString()]), - style: Theme.of(context).textTheme.bodyLarge, + builder: (final context, final snapshot) => ListTile( + title: Text( + 'about_application_page.application_version_text'.tr(), + ), + subtitle: Text( + snapshot.data.toString(), + ), + leading: Icon( + deviceIcon, + ), + onLongPress: () { + PlatformAdapter.setClipboard( + snapshot.data.toString(), + ); + getIt().showSnackBar( + 'basis.copied_to_clipboard'.tr(), + ); + }, ), ), - if (isReady) + if (getIt().apiData.apiVersion.data != null) FutureBuilder( future: _apiVersion(), - builder: (final context, final snapshot) => Text( - 'about_application_page.api_version_text' - .tr(args: [snapshot.data.toString()]), - style: Theme.of(context).textTheme.bodyLarge, + builder: (final context, final snapshot) => ListTile( + title: Text( + 'about_application_page.api_version_text'.tr(), + ), + subtitle: Text(snapshot.data.toString()), + leading: const Icon( + Icons.api_outlined, + ), + onLongPress: () { + PlatformAdapter.setClipboard( + snapshot.data.toString(), + ); + getIt().showSnackBar( + 'basis.copied_to_clipboard'.tr(), + ); + }, ), ), - const SizedBox(height: 10), - // Button to call showAboutDialog - TextButton( - onPressed: () => showAboutDialog( - context: context, - applicationName: 'SelfPrivacy', - applicationLegalese: '© 2024 SelfPrivacy', - // Link to privacy policy - children: [ - TextButton( - onPressed: () => launchUrl( - Uri.parse('https://selfprivacy.org/privacy-policy/'), - mode: LaunchMode.externalApplication, - ), - child: Text('about_application_page.privacy_policy'.tr()), - ), - ], + FutureBuilder( + future: _packageVersion(), + builder: (final context, final snapshot) => ListTile( + title: Text('about_application_page.open_source_licenses'.tr()), + onTap: () => showLicensePage( + context: context, + applicationName: 'SelfPrivacy', + applicationVersion: snapshot.data.toString(), + applicationLegalese: '© 2024 SelfPrivacy', + ), + leading: const Icon( + Icons.copyright_outlined, + ), ), - child: const Text('Show about dialog'), ), - const SizedBox(height: 8), - const Divider(height: 0), - const SizedBox(height: 8), - const BrandMarkdown( - fileName: 'about', + SectionTitle( + title: 'about_application_page.links'.tr(), + ), + LinkListTile( + title: 'about_application_page.website'.tr(), + subtitle: 'selfprivacy.org', + uri: 'https://selfprivacy.org/', + icon: Icons.language_outlined, + ), + LinkListTile( + title: 'about_application_page.documentation'.tr(), + subtitle: 'selfprivacy.org/docs', + uri: 'https://selfprivacy.org/docs/', + icon: Icons.library_books_outlined, + ), + LinkListTile( + title: 'about_application_page.privacy_policy'.tr(), + subtitle: 'selfprivacy.org/privacy-policy', + uri: 'https://selfprivacy.org/privacy-policy/', + icon: Icons.policy_outlined, + ), + LinkListTile( + title: 'about_application_page.matrix_channel'.tr(), + subtitle: '#news:selfprivacy.org', + uri: 'https://matrix.to/#/#news:selfprivacy.org', + icon: Icons.feed_outlined, + longPressText: '#news:selfprivacy.org', + ), + LinkListTile( + title: 'about_application_page.telegram_channel'.tr(), + subtitle: '@selfprivacy', + uri: 'https://t.me/selfprivacy', + icon: Icons.feed_outlined, + longPressText: '@selfprivacy', + ), + SectionTitle(title: 'about_application_page.get_support'.tr()), + LinkListTile( + title: 'about_application_page.matrix_support_chat'.tr(), + subtitle: '#chat:selfprivacy.org', + uri: 'https://matrix.to/#/#chat:selfprivacy.org', + icon: Icons.question_answer_outlined, + longPressText: '#chat:selfprivacy.org', + ), + LinkListTile( + title: 'about_application_page.telegram_support_chat'.tr(), + subtitle: '@selfprivacy_chat', + uri: 'https://t.me/selfprivacy_chat', + icon: Icons.question_answer_outlined, + longPressText: '@selfprivacy_chat', + ), + LinkListTile( + title: 'about_application_page.email_support'.tr(), + subtitle: 'support@selfprivacy.org', + uri: 'mailto:support@selfprivacy.org', + icon: Icons.email_outlined, + longPressText: 'support@selfprivacy.org', + ), + SectionTitle( + title: 'about_application_page.contribute'.tr(), + ), + LinkListTile( + title: 'about_application_page.source_code'.tr(), + subtitle: 'git.selfprivacy.org', + uri: 'https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app', + icon: Icons.code_outlined, + ), + LinkListTile( + title: 'about_application_page.bug_report'.tr(), + subtitle: 'about_application_page.bug_report_subtitle'.tr(), + uri: + 'https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app/issues', + icon: Icons.bug_report_outlined, + ), + LinkListTile( + title: 'about_application_page.help_translate'.tr(), + subtitle: 'weblate.selfprivacy.org', + uri: 'https://weblate.selfprivacy.org/projects/selfprivacy/', + icon: Icons.translate_outlined, + ), + LinkListTile( + title: 'about_application_page.matrix_contributors_chat'.tr(), + subtitle: '#dev:selfprivacy.org', + uri: 'https://matrix.to/#/#dev:selfprivacy.org', + icon: Icons.question_answer_outlined, + longPressText: '#dev:selfprivacy.org', + ), + LinkListTile( + title: 'about_application_page.telegram_contributors_chat'.tr(), + subtitle: '@selfprivacy_dev', + uri: 'https://t.me/selfprivacy_dev', + icon: Icons.question_answer_outlined, + longPressText: '@selfprivacy_dev', ), ], ); @@ -73,7 +204,7 @@ class AboutApplicationPage extends StatelessWidget { String packageVersion = 'unknown'; try { final PackageInfo packageInfo = await PackageInfo.fromPlatform(); - packageVersion = packageInfo.version; + packageVersion = '${packageInfo.version} (${packageInfo.buildNumber})'; } catch (e) { print(e); } @@ -82,13 +213,65 @@ class AboutApplicationPage extends StatelessWidget { } Future _apiVersion() async { - String apiVersion = 'unknown'; - try { - apiVersion = await ServerApi().getApiVersion() ?? apiVersion; - } catch (e) { - print(e); - } + final apiVersion = + getIt().apiData.apiVersion.data ?? 'unknown'; return apiVersion; } } + +class SectionTitle extends StatelessWidget { + const SectionTitle({ + required this.title, + super.key, + }); + + final String title; + + @override + Widget build(final BuildContext context) => Padding( + padding: const EdgeInsets.all(16), + child: Text( + title, + style: Theme.of(context).textTheme.labelLarge!.copyWith( + color: Theme.of(context).colorScheme.secondary, + ), + ), + ); +} + +class LinkListTile extends StatelessWidget { + const LinkListTile({ + required this.title, + required this.subtitle, + required this.uri, + required this.icon, + this.longPressText, + super.key, + }); + + final String title; + final String subtitle; + final String uri; + final IconData icon; + final String? longPressText; + + @override + Widget build(final BuildContext context) => ListTile( + title: Text(title), + subtitle: Text(subtitle), + onTap: () => launchUrl( + Uri.parse(uri), + mode: LaunchMode.externalApplication, + ), + leading: Icon(icon), + onLongPress: () { + PlatformAdapter.setClipboard( + longPressText ?? uri, + ); + getIt().showSnackBar( + 'basis.copied_to_clipboard'.tr(), + ); + }, + ); +} diff --git a/lib/ui/pages/more/about_us.dart b/lib/ui/pages/more/about_us.dart deleted file mode 100644 index 54a3151b..00000000 --- a/lib/ui/pages/more/about_us.dart +++ /dev/null @@ -1,30 +0,0 @@ -import 'package:easy_localization/easy_localization.dart'; -import 'package:flutter/material.dart'; -import 'package:selfprivacy/config/brand_theme.dart'; -import 'package:selfprivacy/ui/components/brand_header/brand_header.dart'; -import 'package:selfprivacy/ui/components/brand_md/brand_md.dart'; - -class AboutUsPage extends StatelessWidget { - const AboutUsPage({super.key}); - - @override - Widget build(final BuildContext context) => SafeArea( - child: Scaffold( - appBar: PreferredSize( - preferredSize: const Size.fromHeight(52), - child: BrandHeader( - title: 'about_us_page.title'.tr(), - hasBackButton: true, - ), - ), - body: ListView( - padding: paddingH15V0, - children: const [ - BrandMarkdown( - fileName: 'about', - ), - ], - ), - ), - ); -} diff --git a/lib/ui/pages/more/more.dart b/lib/ui/pages/more/more.dart index 0dfa3e4e..6e72bdd9 100644 --- a/lib/ui/pages/more/more.dart +++ b/lib/ui/pages/more/more.dart @@ -63,12 +63,12 @@ class MorePage extends StatelessWidget { title: 'devices.main_screen.header'.tr(), ), _MoreMenuItem( - title: 'more_page.application_settings'.tr(), + title: 'application_settings.title'.tr(), iconData: Icons.settings_outlined, goTo: () => const AppSettingsRoute(), ), _MoreMenuItem( - title: 'more_page.about_application'.tr(), + title: 'about_application_page.title'.tr(), iconData: BrandIcons.fire, goTo: () => const AboutApplicationRoute(), longGoTo: const DeveloperSettingsRoute(), @@ -80,7 +80,7 @@ class MorePage extends StatelessWidget { goTo: () => const OnboardingRoute(), ), _MoreMenuItem( - title: 'more_page.console'.tr(), + title: 'console_page.title'.tr(), iconData: BrandIcons.terminal, goTo: () => const ConsoleRoute(), ), diff --git a/lib/ui/router/router.dart b/lib/ui/router/router.dart index 764aacd7..48eb2d5a 100644 --- a/lib/ui/router/router.dart +++ b/lib/ui/router/router.dart @@ -132,7 +132,7 @@ String getRouteTitle(final String routeName) { case 'DevicesRoute': return 'devices.main_screen.header'; case 'AboutApplicationRoute': - return 'about_us_page.title'; + return 'about_application_page.title'; case 'ConsoleRoute': return 'console_page.title'; case 'DeveloperSettingsRoute':