feat: Select share keys with property in security settings
This commit is contained in:
parent
9f9f52fa02
commit
6f3133a07c
6 changed files with 35 additions and 17 deletions
|
|
@ -2840,5 +2840,11 @@
|
|||
"appWantsToUseForLoginDescription": "You hereby allow the app and website to share information about you.",
|
||||
"open": "Open",
|
||||
"waitingForServer": "Waiting for server...",
|
||||
"appIntroduction": "FluffyChat lets you chat with your friends across different messengers. Learn more at https://matrix.org or just tap *Continue*."
|
||||
"appIntroduction": "FluffyChat lets you chat with your friends across different messengers. Learn more at https://matrix.org or just tap *Continue*.",
|
||||
"shareKeysWith": "Share keys with...",
|
||||
"shareKeysWithDescription": "Which devices should be trusted so that they can read along your messages in encrypted chats?",
|
||||
"allDevices": "All devices",
|
||||
"crossVerifiedDevicesIfEnabled": "Cross verified devices if enabled",
|
||||
"crossVerifiedDevices": "Cross verified devices",
|
||||
"verifiedDevicesOnly": "Verified devices only"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:fluffychat/widgets/adaptive_dialogs/show_ok_cancel_alert_dialog.dart';
|
||||
import 'package:fluffychat/widgets/adaptive_dialogs/show_text_input_dialog.dart';
|
||||
import 'package:fluffychat/widgets/app_lock.dart';
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
|
|
@ -10,7 +11,6 @@ import 'package:fluffychat/utils/platform_infos.dart';
|
|||
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import 'package:fluffychat/widgets/settings_switch_list_tile.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'settings_security.dart';
|
||||
|
||||
class SettingsSecurityView extends StatelessWidget {
|
||||
|
|
@ -91,15 +91,13 @@ class SettingsSecurityView extends StatelessWidget {
|
|||
Divider(color: theme.dividerColor),
|
||||
ListTile(
|
||||
title: Text(
|
||||
'Share keys with',
|
||||
L10n.of(context).shareKeysWith,
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.secondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
'Which devices should be trusted so that they can read along your messages in encrypted chats?',
|
||||
),
|
||||
subtitle: Text(L10n.of(context).shareKeysWithDescription),
|
||||
),
|
||||
ListTile(
|
||||
title: Material(
|
||||
|
|
@ -117,7 +115,7 @@ class SettingsSecurityView extends StatelessWidget {
|
|||
.map(
|
||||
(share) => DropdownMenuItem(
|
||||
value: share,
|
||||
child: Text(share.name),
|
||||
child: Text(share.localized(L10n.of(context))),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
|
|
@ -180,3 +178,18 @@ class SettingsSecurityView extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension on ShareKeysWith {
|
||||
String localized(L10n l10n) {
|
||||
switch (this) {
|
||||
case ShareKeysWith.all:
|
||||
return l10n.allDevices;
|
||||
case ShareKeysWith.crossVerifiedIfEnabled:
|
||||
return l10n.crossVerifiedDevicesIfEnabled;
|
||||
case ShareKeysWith.crossVerified:
|
||||
return l10n.crossVerifiedDevices;
|
||||
case ShareKeysWith.directlyVerifiedOnly:
|
||||
return l10n.verifiedDevicesOnly;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:desktop_notifications/desktop_notifications.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
|
|
@ -15,6 +14,7 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||
import 'package:universal_html/html.dart' as html;
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:fluffychat/utils/custom_http_client.dart';
|
||||
import 'package:fluffychat/utils/custom_image_resizer.dart';
|
||||
import 'package:fluffychat/utils/init_with_restore.dart';
|
||||
|
|
|
|||
|
|
@ -1125,10 +1125,11 @@ packages:
|
|||
matrix:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "../matrix-dart-sdk"
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.37.0"
|
||||
name: matrix
|
||||
sha256: d0da69e5ee8dfc1692c02e4b460a1bc136120f0dcf5e02cf604b23cd39d76903
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.38.0"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ dependencies:
|
|||
just_audio: ^0.9.39
|
||||
latlong2: ^0.9.1
|
||||
linkify: ^5.0.0
|
||||
matrix: ^0.37.0
|
||||
matrix: ^0.38.0
|
||||
mime: ^1.0.6
|
||||
native_imaging: ^0.1.1
|
||||
opus_caf_converter_dart: ^1.0.1
|
||||
|
|
@ -153,5 +153,3 @@ msix_config:
|
|||
|
||||
dependency_overrides:
|
||||
win32: 5.5.3
|
||||
matrix:
|
||||
path: ../matrix-dart-sdk/
|
||||
Loading…
Add table
Reference in a new issue