|
|
|
@ -42,6 +42,71 @@ class SettingsSecurityView extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
ListTile(
|
|
|
|
|
title: Text(
|
|
|
|
|
L10n.of(context)!.privacy,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Theme.of(context).colorScheme.secondary,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SettingsSwitchListTile.adaptive(
|
|
|
|
|
title: L10n.of(context)!.sendTypingNotifications,
|
|
|
|
|
subtitle:
|
|
|
|
|
L10n.of(context)!.sendTypingNotificationsDescription,
|
|
|
|
|
onChanged: (b) => AppConfig.sendTypingNotifications = b,
|
|
|
|
|
storeKey: SettingKeys.sendTypingNotifications,
|
|
|
|
|
defaultValue: AppConfig.sendTypingNotifications,
|
|
|
|
|
),
|
|
|
|
|
SettingsSwitchListTile.adaptive(
|
|
|
|
|
title: L10n.of(context)!.sendReadReceipts,
|
|
|
|
|
subtitle: L10n.of(context)!.sendReadReceiptsDescription,
|
|
|
|
|
onChanged: (b) => AppConfig.sendPublicReadReceipts = b,
|
|
|
|
|
storeKey: SettingKeys.sendPublicReadReceipts,
|
|
|
|
|
defaultValue: AppConfig.sendPublicReadReceipts,
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
trailing: const Icon(Icons.chevron_right_outlined),
|
|
|
|
|
title: Text(L10n.of(context)!.blockedUsers),
|
|
|
|
|
subtitle: Text(
|
|
|
|
|
L10n.of(context)!.thereAreCountUsersBlocked(
|
|
|
|
|
Matrix.of(context).client.ignoredUsers.length,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
onTap: () =>
|
|
|
|
|
context.go('/rooms/settings/security/ignorelist'),
|
|
|
|
|
),
|
|
|
|
|
if (Matrix.of(context).client.encryption != null) ...{
|
|
|
|
|
if (PlatformInfos.isMobile)
|
|
|
|
|
ListTile(
|
|
|
|
|
leading: const Icon(Icons.lock_outlined),
|
|
|
|
|
trailing: const Icon(Icons.chevron_right_outlined),
|
|
|
|
|
title: Text(L10n.of(context)!.appLock),
|
|
|
|
|
onTap: controller.setAppLockAction,
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
Divider(
|
|
|
|
|
height: 1,
|
|
|
|
|
color: Theme.of(context).dividerColor,
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
title: Text(
|
|
|
|
|
L10n.of(context)!.account,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Theme.of(context).colorScheme.secondary,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
title: Text(L10n.of(context)!.yourPublicKey),
|
|
|
|
|
leading: const Icon(Icons.vpn_key_outlined),
|
|
|
|
|
subtitle: SelectableText(
|
|
|
|
|
Matrix.of(context).client.fingerprintKey.beautified,
|
|
|
|
|
style: const TextStyle(fontFamily: 'monospace'),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (error != null)
|
|
|
|
|
ListTile(
|
|
|
|
|
leading: const Icon(
|
|
|
|
@ -54,9 +119,9 @@ class SettingsSecurityView extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (capabilities?.mChangePassword?.enabled != false ||
|
|
|
|
|
error != null) ...[
|
|
|
|
|
error != null)
|
|
|
|
|
ListTile(
|
|
|
|
|
leading: const Icon(Icons.key_outlined),
|
|
|
|
|
leading: const Icon(Icons.password_outlined),
|
|
|
|
|
trailing: error != null
|
|
|
|
|
? null
|
|
|
|
|
: const Icon(Icons.chevron_right_outlined),
|
|
|
|
@ -72,49 +137,17 @@ class SettingsSecurityView extends StatelessWidget {
|
|
|
|
|
: () =>
|
|
|
|
|
context.go('/rooms/settings/security/password'),
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
leading: const Icon(Icons.mail_outlined),
|
|
|
|
|
trailing: error != null
|
|
|
|
|
? null
|
|
|
|
|
: const Icon(Icons.chevron_right_outlined),
|
|
|
|
|
title: Text(
|
|
|
|
|
L10n.of(context)!.passwordRecovery,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
decoration:
|
|
|
|
|
error == null ? null : TextDecoration.lineThrough,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
onTap: error != null
|
|
|
|
|
? null
|
|
|
|
|
: () => context.go('/rooms/settings/security/3pid'),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
ListTile(
|
|
|
|
|
leading: const Icon(Icons.block_outlined),
|
|
|
|
|
trailing: const Icon(Icons.chevron_right_outlined),
|
|
|
|
|
title: Text(L10n.of(context)!.blockedUsers),
|
|
|
|
|
onTap: () =>
|
|
|
|
|
context.go('/rooms/settings/security/ignorelist'),
|
|
|
|
|
),
|
|
|
|
|
if (Matrix.of(context).client.encryption != null) ...{
|
|
|
|
|
if (PlatformInfos.isMobile)
|
|
|
|
|
ListTile(
|
|
|
|
|
leading: const Icon(Icons.lock_outlined),
|
|
|
|
|
trailing: const Icon(Icons.chevron_right_outlined),
|
|
|
|
|
title: Text(L10n.of(context)!.appLock),
|
|
|
|
|
onTap: controller.setAppLockAction,
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
const Divider(height: 1),
|
|
|
|
|
ListTile(
|
|
|
|
|
iconColor: Colors.orange,
|
|
|
|
|
leading: const Icon(Icons.tap_and_play),
|
|
|
|
|
title: Text(
|
|
|
|
|
L10n.of(context)!.dehydrate,
|
|
|
|
|
style: const TextStyle(color: Colors.red),
|
|
|
|
|
style: const TextStyle(color: Colors.orange),
|
|
|
|
|
),
|
|
|
|
|
onTap: controller.dehydrateAction,
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
iconColor: Colors.red,
|
|
|
|
|
leading: const Icon(Icons.delete_outlined),
|
|
|
|
|
title: Text(
|
|
|
|
|
L10n.of(context)!.deleteAccount,
|
|
|
|
@ -122,30 +155,6 @@ class SettingsSecurityView extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
onTap: controller.deleteAccountAction,
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
title: Text(L10n.of(context)!.yourPublicKey),
|
|
|
|
|
subtitle: SelectableText(
|
|
|
|
|
Matrix.of(context).client.fingerprintKey.beautified,
|
|
|
|
|
style: const TextStyle(fontFamily: 'monospace'),
|
|
|
|
|
),
|
|
|
|
|
leading: const Icon(Icons.vpn_key_outlined),
|
|
|
|
|
),
|
|
|
|
|
const Divider(height: 1),
|
|
|
|
|
SettingsSwitchListTile.adaptive(
|
|
|
|
|
title: L10n.of(context)!.sendTypingNotifications,
|
|
|
|
|
subtitle:
|
|
|
|
|
L10n.of(context)!.sendTypingNotificationsDescription,
|
|
|
|
|
onChanged: (b) => AppConfig.sendTypingNotifications = b,
|
|
|
|
|
storeKey: SettingKeys.sendTypingNotifications,
|
|
|
|
|
defaultValue: AppConfig.sendTypingNotifications,
|
|
|
|
|
),
|
|
|
|
|
SettingsSwitchListTile.adaptive(
|
|
|
|
|
title: L10n.of(context)!.sendReadReceipts,
|
|
|
|
|
subtitle: L10n.of(context)!.sendReadReceiptsDescription,
|
|
|
|
|
onChanged: (b) => AppConfig.sendPublicReadReceipts = b,
|
|
|
|
|
storeKey: SettingKeys.sendPublicReadReceipts,
|
|
|
|
|
defaultValue: AppConfig.sendPublicReadReceipts,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|