diff --git a/fonts/Roboto/RobotoMono-Regular.ttf b/fonts/Roboto/RobotoMono-Regular.ttf new file mode 100644 index 00000000..d9371a1b Binary files /dev/null and b/fonts/Roboto/RobotoMono-Regular.ttf differ diff --git a/lib/pages/chat_encryption_settings/chat_encryption_settings_view.dart b/lib/pages/chat_encryption_settings/chat_encryption_settings_view.dart index 276c8c61..2840921e 100644 --- a/lib/pages/chat_encryption_settings/chat_encryption_settings_view.dart +++ b/lib/pages/chat_encryption_settings/chat_encryption_settings_view.dart @@ -7,6 +7,7 @@ import 'package:vrouter/vrouter.dart'; import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/pages/chat_encryption_settings/chat_encryption_settings.dart'; +import 'package:fluffychat/utils/beautify_string_extension.dart'; class ChatEncryptionSettingsView extends StatelessWidget { final ChatEncryptionSettingsController controller; @@ -164,13 +165,13 @@ class ChatEncryptionSettingsView extends StatelessWidget { ], ), subtitle: Text( - deviceKeys[i].ed25519Key?.replaceAllMapped( - RegExp(r'.{4}'), - (s) => '${s.group(0)} ') ?? + deviceKeys[i].ed25519Key?.beautified ?? L10n.of(context)! .unknownEncryptionAlgorithm, - style: const TextStyle( - fontFamily: 'monospace', + style: TextStyle( + fontFamily: 'RobotoMono', + color: + Theme.of(context).colorScheme.secondary, ), ), ), diff --git a/lib/utils/beautify_string_extension.dart b/lib/utils/beautify_string_extension.dart index b555d6de..3e01fb7a 100644 --- a/lib/utils/beautify_string_extension.dart +++ b/lib/utils/beautify_string_extension.dart @@ -4,7 +4,7 @@ extension BeautifyStringExtension on String { for (var i = 0; i < length; i++) { beautifiedStr += substring(i, i + 1); if (i % 4 == 3) { - beautifiedStr += ' '; + beautifiedStr += ' '; } if (i % 16 == 15) { beautifiedStr += '\n'; diff --git a/pubspec.yaml b/pubspec.yaml index 7892f7ce..e3273c85 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -124,6 +124,9 @@ flutter: style: italic - asset: fonts/Roboto/Roboto-Bold.ttf weight: 700 + - family: RobotoMono + fonts: + - asset: fonts/Roboto/RobotoMono-Regular.ttf - family: NotoEmoji fonts: - asset: fonts/NotoEmoji/NotoColorEmoji.ttf