Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -462,4 +462,9 @@
"noFollowsConversations": "Keine Unterhaltungen mit Personen, denen Sie folgen",
"noKnownConversations": "Keine Unterhaltungen mit bekannten Kontakten",
"noMessageRequests": "Keine Nachrichtenanfragen"
,
"imprint": "Impressum",
"@imprint": {
"description": "Imprint page title"
}
}
12 changes: 10 additions & 2 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1627,8 +1627,12 @@
"@relayStatusExcellentDescription": {
"description": "Status description when relay connection is excellent",
"placeholders": {
"myCount": {"type": "int"},
"peerCount": {"type": "int"}
"myCount": {
"type": "int"
},
"peerCount": {
"type": "int"
}
}
},
"relayStatusDegradedMyOnly": "Connected to your relays, but not to peer's DM relays. Messages may be delayed.",
Expand Down Expand Up @@ -1682,5 +1686,9 @@
"noMessageRequests": "No message requests",
"@noMessageRequests": {
"description": "Empty state for requests DM tab"
},
"imprint": "Imprint",
"@imprint": {
"description": "Imprint page title"
}
}
5 changes: 5 additions & 0 deletions lib/l10n/app_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -465,4 +465,9 @@
"noFollowsConversations": "No hay conversaciones con personas que sigues",
"noKnownConversations": "No hay conversaciones con contactos conocidos",
"noMessageRequests": "No hay solicitudes de mensajes"
,
"imprint": "Aviso legal",
"@imprint": {
"description": "Imprint page title"
}
}
5 changes: 5 additions & 0 deletions lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -464,4 +464,9 @@
"noFollowsConversations": "Aucune conversation avec les personnes que vous suivez",
"noKnownConversations": "Aucune conversation avec des contacts connus",
"noMessageRequests": "Aucune demande de message"
,
"imprint": "Mentions légales",
"@imprint": {
"description": "Imprint page title"
}
}
5 changes: 5 additions & 0 deletions lib/l10n/app_ja.arb
Original file line number Diff line number Diff line change
Expand Up @@ -421,4 +421,9 @@
"noKnownConversations": "既知の連絡先との会話はありません",
"noMessageRequests": "メッセージリクエストはありません",
"failed": "失敗"
,
"imprint": "インプリント",
"@imprint": {
"description": "Imprint page title"
}
}
5 changes: 5 additions & 0 deletions lib/l10n/app_pt.arb
Original file line number Diff line number Diff line change
Expand Up @@ -464,4 +464,9 @@
"noFollowsConversations": "Nenhuma conversa com pessoas que você segue",
"noKnownConversations": "Nenhuma conversa com contatos conhecidos",
"noMessageRequests": "Nenhum pedido de mensagem"
,
"imprint": "Impressão",
"@imprint": {
"description": "Imprint page title"
}
}
5 changes: 5 additions & 0 deletions lib/l10n/app_ru.arb
Original file line number Diff line number Diff line change
Expand Up @@ -421,4 +421,9 @@
"noKnownConversations": "Нет разговоров с известными контактами",
"noMessageRequests": "Нет запросов на сообщения",
"failed": "Ошибка"
,
"imprint": "Выходные данные",
"@imprint": {
"description": "Imprint page title"
}
}
5 changes: 5 additions & 0 deletions lib/l10n/app_th.arb
Original file line number Diff line number Diff line change
Expand Up @@ -421,4 +421,9 @@
"noKnownConversations": "ไม่มีการสนทนากับผู้ติดต่อที่รู้จัก",
"noMessageRequests": "ไม่มีคำขอข้อความ",
"failed": "ล้มเหลว"
,
"imprint": "ข้อมูลทางกฎหมาย",
"@imprint": {
"description": "Imprint page title"
}
}
5 changes: 5 additions & 0 deletions lib/l10n/app_zh.arb
Original file line number Diff line number Diff line change
Expand Up @@ -421,4 +421,9 @@
"noKnownConversations": "没有与已知联系人的对话",
"noMessageRequests": "没有消息请求",
"failed": "失败"
,
"imprint": "法律声明",
"@imprint": {
"description": "Imprint page title"
}
}
110 changes: 46 additions & 64 deletions lib/presentation_layer/components/drawer/nostr_side_menu.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:phosphor_flutter/phosphor_flutter.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:url_launcher/url_launcher.dart';
Expand Down Expand Up @@ -93,12 +91,6 @@ class NostrSideMenu extends ConsumerWidget {
);
}

Future<PackageInfo> _getPackageInfo() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();

return packageInfo;
}

void navigateToProfile(BuildContext context, String pubkey) {
context.push(RoutePaths.profile(pubkey: pubkey));
}
Expand Down Expand Up @@ -324,7 +316,7 @@ class NostrSideMenu extends ConsumerWidget {
),
_divider(context),
Padding(
padding: const EdgeInsets.only(left: 20),
padding: const EdgeInsets.only(left: 5),
child: _textButton(
text: AppLocalizations.of(context)!.settings,
onPressed: () {
Expand All @@ -334,56 +326,54 @@ class NostrSideMenu extends ConsumerWidget {
),
),
const SizedBox(height: 10),
Padding(
padding: const EdgeInsets.fromLTRB(20, 10, 15, 20),
child: _textButton(
text: AppLocalizations.of(context)!.termsOfService,
context: context,
onPressed: () {
// lauch url
Uri url = Uri.parse("https://camelus.app/terms");
launchUrl(url, mode: LaunchMode.externalApplication);
},
),
),

Padding(
padding: EdgeInsets.only(left: 20),
child: FutureBuilder(
future: _getPackageInfo(),
builder: (context, snapshot) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'v${snapshot.data?.version}',
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontSize: 10,
),
),
Text(
'build ${snapshot.data?.buildNumber}',
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontSize: 8,
),
),
Text(
'${snapshot.data?.buildSignature}',
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontSize: 6,
),
),
],
);
},
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
style: TextButton.styleFrom(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
minimumSize: const Size(50, 10),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
onPressed: () {
final url = Uri.parse("https://camelus.app/terms");
launchUrl(url, mode: LaunchMode.externalApplication);
},
child: Text(
AppLocalizations.of(context)!.termsOfService,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontSize: 12,
fontWeight: FontWeight.normal,
),
),
),

TextButton(
style: TextButton.styleFrom(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
minimumSize: const Size(50, 10),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
onPressed: () {
final url = Uri.parse("https://camelus.app/imprint");
launchUrl(url, mode: LaunchMode.externalApplication);
},
child: Text(
AppLocalizations.of(context)!.imprint,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontSize: 12,
fontWeight: FontWeight.normal,
),
),
),
],
),
_divider(context),
Padding(
padding: const EdgeInsets.fromLTRB(20, 10, 15, 20),
padding: const EdgeInsets.fromLTRB(20, 0, 15, 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand All @@ -404,15 +394,7 @@ class NostrSideMenu extends ConsumerWidget {
onPressed: () {
openQrShareDialog(context, currentUserPubkey);
},
icon: SvgPicture.asset(
'assets/icons/qr-code.svg',
colorFilter: ColorFilter.mode(
Theme.of(context).colorScheme.primary,
BlendMode.srcIn,
),
height: 22,
width: 22,
),
icon: Icon(PhosphorIcons.qrCode()),
),
],
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:package_info_plus/package_info_plus.dart';

import '../../../../providers/developer_settings_provider.dart';

class DeveloperSettingsPage extends ConsumerWidget {
const DeveloperSettingsPage({super.key});

Future<PackageInfo> _getPackageInfo() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();

return packageInfo;
}

@override
Widget build(BuildContext context, WidgetRef ref) {
final state = ref.watch(developerSettingsProvider);
Expand All @@ -21,6 +28,38 @@ class DeveloperSettingsPage extends ConsumerWidget {
value: state.showPerformanceOverlay,
onChanged: notifier.setShowPerformanceOverlay,
),
const Divider(),
FutureBuilder(
future: _getPackageInfo(),
builder: (context, snapshot) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'v${snapshot.data?.version}',
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontSize: 10,
),
),
Text(
'build ${snapshot.data?.buildNumber}',
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontSize: 10,
),
),
Text(
'${snapshot.data?.buildSignature}',
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontSize: 8,
),
),
],
);
},
),
],
),
);
Expand Down