Merge pull request 'Add website and support links to the About page' (#464) from inex/about-page into api-connection-refactor
Reviewed-on: #464pull/466/head
commit
e193387ba5
|
@ -1,12 +0,0 @@
|
||||||
### Пра нас
|
|
||||||
|
|
||||||
Усё больш арганізацый жадаюць валодаць нашымі дадзенымі
|
|
||||||
Праект дазваляе толькі Вам у поўнай меры распараджацца ўласнымі **дадзенымі** на сваім сэрвэры.
|
|
||||||
|
|
||||||
### Наша місія
|
|
||||||
|
|
||||||
Лічбавая незалежнасць і прыватнасць, даступныя кожнаму
|
|
||||||
|
|
||||||
### Мэта
|
|
||||||
|
|
||||||
Распрацаваць праграму, якая дазволіць кожнаму разгарнуць свае прыватныя паслугі для сябе і сваіх суседзяў.
|
|
|
@ -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.
|
|
|
@ -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.
|
|
|
@ -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.
|
|
|
@ -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.
|
|
|
@ -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.
|
|
|
@ -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.
|
|
|
@ -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.
|
|
|
@ -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.
|
|
|
@ -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.
|
|
|
@ -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.
|
|
|
@ -1,12 +0,0 @@
|
||||||
### О проекте
|
|
||||||
|
|
||||||
Всё больше организаций хотят владеть нашими данными
|
|
||||||
Проект позволяет только Вам в полной мере распоряжаться собственными **данными** на своём сервере.
|
|
||||||
|
|
||||||
### Миссия проекта
|
|
||||||
|
|
||||||
Цифровая независимость и приватность, доступная каждому
|
|
||||||
|
|
||||||
### Цель
|
|
||||||
|
|
||||||
Развивать программу, которая позволит каждому создавать приватные сервисы для себя и своих близких.
|
|
|
@ -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.
|
|
|
@ -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.
|
|
|
@ -1,12 +0,0 @@
|
||||||
### Про нас
|
|
||||||
|
|
||||||
Все більше корпорацій хочуть контролювати свої дані.
|
|
||||||
Ми хочемо мати повний контроль над нашими.
|
|
||||||
|
|
||||||
### Наша місія
|
|
||||||
|
|
||||||
Цифрова незалежність і конфіденційність доступні кожному
|
|
||||||
|
|
||||||
### Ціль
|
|
||||||
|
|
||||||
Розробити програму, яка дозволить кожному розгорнути свої приватні послуги для себе та їх сусідів.
|
|
|
@ -41,25 +41,36 @@
|
||||||
},
|
},
|
||||||
"more_page": {
|
"more_page": {
|
||||||
"configuration_wizard": "Setup wizard",
|
"configuration_wizard": "Setup wizard",
|
||||||
"about_project": "About us",
|
|
||||||
"about_application": "About",
|
|
||||||
"onboarding": "Onboarding",
|
"onboarding": "Onboarding",
|
||||||
"create_ssh_key": "Superuser SSH keys",
|
"create_ssh_key": "Superuser SSH keys"
|
||||||
"console": "Console",
|
|
||||||
"application_settings": "Application settings"
|
|
||||||
},
|
},
|
||||||
"console_page": {
|
"console_page": {
|
||||||
"title": "Console",
|
"title": "Console",
|
||||||
"waiting": "Waiting for initialization…",
|
"waiting": "Waiting for initialization…",
|
||||||
"copy": "Copy"
|
"copy": "Copy"
|
||||||
},
|
},
|
||||||
"about_us_page": {
|
|
||||||
"title": "About us"
|
|
||||||
},
|
|
||||||
"about_application_page": {
|
"about_application_page": {
|
||||||
"title": "About",
|
"title": "About & support",
|
||||||
"application_version_text": "Application version {}",
|
"versions": "Versions",
|
||||||
"api_version_text": "Server API version {}",
|
"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"
|
"privacy_policy": "Privacy policy"
|
||||||
},
|
},
|
||||||
"application_settings": {
|
"application_settings": {
|
||||||
|
|
|
@ -17,10 +17,6 @@ class StrayDeerPainter extends CustomPainter {
|
||||||
final Color deerSkin =
|
final Color deerSkin =
|
||||||
const Color(0xffe0ac9c).harmonizeWith(colorScheme.primary);
|
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();
|
final Path path0 = Path();
|
||||||
path0.moveTo(size.width * 0.6099773, size.height * 0.6719577);
|
path0.moveTo(size.width * 0.6099773, size.height * 0.6719577);
|
||||||
path0.lineTo(size.width * 0.6088435, size.height * 0.6719577);
|
path0.lineTo(size.width * 0.6088435, size.height * 0.6719577);
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:auto_route/auto_route.dart';
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:package_info/package_info.dart';
|
import 'package:package_info/package_info.dart';
|
||||||
import 'package:selfprivacy/logic/api_maps/graphql_maps/server_api/server_api.dart';
|
import 'package:selfprivacy/config/get_it_config.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/ui/layouts/brand_hero_screen.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';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
@RoutePage()
|
@RoutePage()
|
||||||
|
@ -14,56 +16,185 @@ class AboutApplicationPage extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(final BuildContext context) {
|
Widget build(final BuildContext context) {
|
||||||
final bool isReady = context.watch<ServerInstallationCubit>().state
|
IconData getPlatformIcon() {
|
||||||
is ServerInstallationFinished;
|
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(
|
return BrandHeroScreen(
|
||||||
hasBackButton: true,
|
hasBackButton: true,
|
||||||
hasFlashButton: false,
|
hasFlashButton: false,
|
||||||
heroTitle: 'about_application_page.title'.tr(),
|
heroTitle: 'about_application_page.title'.tr(),
|
||||||
|
bodyPadding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
children: [
|
children: [
|
||||||
|
SectionTitle(title: 'about_application_page.versions'.tr()),
|
||||||
FutureBuilder(
|
FutureBuilder(
|
||||||
future: _packageVersion(),
|
future: _packageVersion(),
|
||||||
builder: (final context, final snapshot) => Text(
|
builder: (final context, final snapshot) => ListTile(
|
||||||
'about_application_page.application_version_text'
|
title: Text(
|
||||||
.tr(args: [snapshot.data.toString()]),
|
'about_application_page.application_version_text'.tr(),
|
||||||
style: Theme.of(context).textTheme.bodyLarge,
|
),
|
||||||
|
subtitle: Text(
|
||||||
|
snapshot.data.toString(),
|
||||||
|
),
|
||||||
|
leading: Icon(
|
||||||
|
deviceIcon,
|
||||||
|
),
|
||||||
|
onLongPress: () {
|
||||||
|
PlatformAdapter.setClipboard(
|
||||||
|
snapshot.data.toString(),
|
||||||
|
);
|
||||||
|
getIt<NavigationService>().showSnackBar(
|
||||||
|
'basis.copied_to_clipboard'.tr(),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (isReady)
|
if (getIt<ApiConnectionRepository>().apiData.apiVersion.data != null)
|
||||||
FutureBuilder(
|
FutureBuilder(
|
||||||
future: _apiVersion(),
|
future: _apiVersion(),
|
||||||
builder: (final context, final snapshot) => Text(
|
builder: (final context, final snapshot) => ListTile(
|
||||||
'about_application_page.api_version_text'
|
title: Text(
|
||||||
.tr(args: [snapshot.data.toString()]),
|
'about_application_page.api_version_text'.tr(),
|
||||||
style: Theme.of(context).textTheme.bodyLarge,
|
),
|
||||||
|
subtitle: Text(snapshot.data.toString()),
|
||||||
|
leading: const Icon(
|
||||||
|
Icons.api_outlined,
|
||||||
|
),
|
||||||
|
onLongPress: () {
|
||||||
|
PlatformAdapter.setClipboard(
|
||||||
|
snapshot.data.toString(),
|
||||||
|
);
|
||||||
|
getIt<NavigationService>().showSnackBar(
|
||||||
|
'basis.copied_to_clipboard'.tr(),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
FutureBuilder(
|
||||||
// Button to call showAboutDialog
|
future: _packageVersion(),
|
||||||
TextButton(
|
builder: (final context, final snapshot) => ListTile(
|
||||||
onPressed: () => showAboutDialog(
|
title: Text('about_application_page.open_source_licenses'.tr()),
|
||||||
context: context,
|
onTap: () => showLicensePage(
|
||||||
applicationName: 'SelfPrivacy',
|
context: context,
|
||||||
applicationLegalese: '© 2024 SelfPrivacy',
|
applicationName: 'SelfPrivacy',
|
||||||
// Link to privacy policy
|
applicationVersion: snapshot.data.toString(),
|
||||||
children: [
|
applicationLegalese: '© 2024 SelfPrivacy',
|
||||||
TextButton(
|
),
|
||||||
onPressed: () => launchUrl(
|
leading: const Icon(
|
||||||
Uri.parse('https://selfprivacy.org/privacy-policy/'),
|
Icons.copyright_outlined,
|
||||||
mode: LaunchMode.externalApplication,
|
),
|
||||||
),
|
|
||||||
child: Text('about_application_page.privacy_policy'.tr()),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
child: const Text('Show about dialog'),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
SectionTitle(
|
||||||
const Divider(height: 0),
|
title: 'about_application_page.links'.tr(),
|
||||||
const SizedBox(height: 8),
|
),
|
||||||
const BrandMarkdown(
|
LinkListTile(
|
||||||
fileName: 'about',
|
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';
|
String packageVersion = 'unknown';
|
||||||
try {
|
try {
|
||||||
final PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
final PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
||||||
packageVersion = packageInfo.version;
|
packageVersion = '${packageInfo.version} (${packageInfo.buildNumber})';
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
}
|
}
|
||||||
|
@ -82,13 +213,65 @@ class AboutApplicationPage extends StatelessWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> _apiVersion() async {
|
Future<String> _apiVersion() async {
|
||||||
String apiVersion = 'unknown';
|
final apiVersion =
|
||||||
try {
|
getIt<ApiConnectionRepository>().apiData.apiVersion.data ?? 'unknown';
|
||||||
apiVersion = await ServerApi().getApiVersion() ?? apiVersion;
|
|
||||||
} catch (e) {
|
|
||||||
print(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return apiVersion;
|
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<NavigationService>().showSnackBar(
|
||||||
|
'basis.copied_to_clipboard'.tr(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
@ -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',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
|
@ -63,12 +63,12 @@ class MorePage extends StatelessWidget {
|
||||||
title: 'devices.main_screen.header'.tr(),
|
title: 'devices.main_screen.header'.tr(),
|
||||||
),
|
),
|
||||||
_MoreMenuItem(
|
_MoreMenuItem(
|
||||||
title: 'more_page.application_settings'.tr(),
|
title: 'application_settings.title'.tr(),
|
||||||
iconData: Icons.settings_outlined,
|
iconData: Icons.settings_outlined,
|
||||||
goTo: () => const AppSettingsRoute(),
|
goTo: () => const AppSettingsRoute(),
|
||||||
),
|
),
|
||||||
_MoreMenuItem(
|
_MoreMenuItem(
|
||||||
title: 'more_page.about_application'.tr(),
|
title: 'about_application_page.title'.tr(),
|
||||||
iconData: BrandIcons.fire,
|
iconData: BrandIcons.fire,
|
||||||
goTo: () => const AboutApplicationRoute(),
|
goTo: () => const AboutApplicationRoute(),
|
||||||
longGoTo: const DeveloperSettingsRoute(),
|
longGoTo: const DeveloperSettingsRoute(),
|
||||||
|
@ -80,7 +80,7 @@ class MorePage extends StatelessWidget {
|
||||||
goTo: () => const OnboardingRoute(),
|
goTo: () => const OnboardingRoute(),
|
||||||
),
|
),
|
||||||
_MoreMenuItem(
|
_MoreMenuItem(
|
||||||
title: 'more_page.console'.tr(),
|
title: 'console_page.title'.tr(),
|
||||||
iconData: BrandIcons.terminal,
|
iconData: BrandIcons.terminal,
|
||||||
goTo: () => const ConsoleRoute(),
|
goTo: () => const ConsoleRoute(),
|
||||||
),
|
),
|
||||||
|
|
|
@ -132,7 +132,7 @@ String getRouteTitle(final String routeName) {
|
||||||
case 'DevicesRoute':
|
case 'DevicesRoute':
|
||||||
return 'devices.main_screen.header';
|
return 'devices.main_screen.header';
|
||||||
case 'AboutApplicationRoute':
|
case 'AboutApplicationRoute':
|
||||||
return 'about_us_page.title';
|
return 'about_application_page.title';
|
||||||
case 'ConsoleRoute':
|
case 'ConsoleRoute':
|
||||||
return 'console_page.title';
|
return 'console_page.title';
|
||||||
case 'DeveloperSettingsRoute':
|
case 'DeveloperSettingsRoute':
|
||||||
|
|
Loading…
Reference in New Issue