diff --git a/lib/config/app_config.dart b/lib/config/app_config.dart index 76cb183f..1e53ef31 100644 --- a/lib/config/app_config.dart +++ b/lib/config/app_config.dart @@ -43,6 +43,7 @@ abstract class AppConfig { static const bool hideTypingUsernames = false; static const bool hideAllStateEvents = false; static const String inviteLinkPrefix = 'https://matrix.to/#/'; + static const String deepLinkPrefix = 'im.fluffychat://chat/'; static const String schemePrefix = 'matrix:'; static const String pushNotificationsChannelId = 'fluffychat_push'; static const String pushNotificationsChannelName = 'FluffyChat push channel'; diff --git a/lib/config/themes.dart b/lib/config/themes.dart index d20b98b6..be9c38df 100644 --- a/lib/config/themes.dart +++ b/lib/config/themes.dart @@ -135,7 +135,7 @@ abstract class FluffyThemes { primary: FluffyThemes.lighten(AppConfig.chatColor, 0.33), secondary: FluffyThemes.lighten(AppConfig.chatColor, 0.33), secondaryVariant: AppConfig.secondaryColor, - surface: FluffyThemes.darken(AppConfig.chatColor, 0.4), + surface: FluffyThemes.darken(AppConfig.chatColor, 0.35), ), secondaryHeaderColor: Colors.blueGrey.shade900, textTheme: Typography.material2018().white.merge(fallbackTextTheme), diff --git a/lib/pages/chat/chat_view.dart b/lib/pages/chat/chat_view.dart index d1fd0e13..04c2273f 100644 --- a/lib/pages/chat/chat_view.dart +++ b/lib/pages/chat/chat_view.dart @@ -83,7 +83,10 @@ class ChatView extends StatelessWidget { child: Row( mainAxisSize: MainAxisSize.min, children: [ - const Icon(Icons.report_outlined), + const Icon( + Icons.shield_outlined, + color: Colors.red, + ), const SizedBox(width: 12), Text(L10n.of(context).reportMessage), ], @@ -331,7 +334,7 @@ class ChatView extends StatelessWidget { .secondaryHeaderColor .withAlpha(100), clipBehavior: Clip.hardEdge, - color: Theme.of(context).backgroundColor, + color: Theme.of(context).appBarTheme.backgroundColor, child: SafeArea( child: Column( mainAxisSize: MainAxisSize.min, diff --git a/lib/pages/chat/event_info_dialog.dart b/lib/pages/chat/event_info_dialog.dart index 15f765d5..679c34d4 100644 --- a/lib/pages/chat/event_info_dialog.dart +++ b/lib/pages/chat/event_info_dialog.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:matrix/matrix.dart'; +import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/utils/date_time_extension.dart'; import 'package:fluffychat/widgets/avatar.dart'; @@ -27,7 +28,7 @@ class EventInfoDialog extends StatelessWidget { String get prettyJson { const JsonDecoder decoder = JsonDecoder(); - const JsonEncoder encoder = JsonEncoder.withIndent(' '); + const JsonEncoder encoder = JsonEncoder.withIndent(' '); final object = decoder.convert(jsonEncode(event.toJson())); return encoder.convert(object); } @@ -52,7 +53,7 @@ class EventInfoDialog extends StatelessWidget { ), title: Text(L10n.of(context).sender), subtitle: - Text('${event.sender.calcDisplayname()} <${event.senderId}>'), + Text('${event.sender.calcDisplayname()} [${event.senderId}]'), ), ListTile( title: Text(L10n.of(context).time), @@ -62,14 +63,17 @@ class EventInfoDialog extends StatelessWidget { title: Text(L10n.of(context).messageType), subtitle: Text(event.humanreadableType), ), - ListTile( - title: Text(L10n.of(context).sourceCode), - ), + ListTile(title: Text('${L10n.of(context).sourceCode}:')), Padding( padding: const EdgeInsets.all(12.0), - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Text(prettyJson), + child: Material( + borderRadius: BorderRadius.circular(AppConfig.borderRadius), + color: Theme.of(context).colorScheme.surface, + child: SingleChildScrollView( + padding: const EdgeInsets.all(8), + scrollDirection: Axis.horizontal, + child: SelectableText(prettyJson), + ), ), ), ], diff --git a/lib/pages/chat/events/message.dart b/lib/pages/chat/events/message.dart index b924e0c3..bf5243eb 100644 --- a/lib/pages/chat/events/message.dart +++ b/lib/pages/chat/events/message.dart @@ -220,22 +220,25 @@ class Message extends StatelessWidget { ), if (event.hasAggregatedEvents( timeline, RelationshipTypes.edit)) - Row( - mainAxisSize: MainAxisSize.min, - children: [ - Icon( - Icons.edit_outlined, - color: textColor.withAlpha(164), - size: 14, - ), - Text( - ' - ${displayEvent.originServerTs.localizedTimeShort(context)}', - style: TextStyle( + Padding( + padding: const EdgeInsets.only(top: 4.0), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.edit_outlined, color: textColor.withAlpha(164), - fontSize: 12, + size: 14, ), - ), - ], + Text( + ' - ${displayEvent.originServerTs.localizedTimeShort(context)}', + style: TextStyle( + color: textColor.withAlpha(164), + fontSize: 12, + ), + ), + ], + ), ), ], ), diff --git a/lib/utils/url_launcher.dart b/lib/utils/url_launcher.dart index 8b04a67c..05f81e94 100644 --- a/lib/utils/url_launcher.dart +++ b/lib/utils/url_launcher.dart @@ -20,7 +20,8 @@ class UrlLauncher { const UrlLauncher(this.context, this.url); void launchUrl() { - if (url.toLowerCase().startsWith(AppConfig.inviteLinkPrefix) || + if (url.toLowerCase().startsWith(AppConfig.deepLinkPrefix) || + url.toLowerCase().startsWith(AppConfig.inviteLinkPrefix) || {'#', '@', '!', '+', '\$'}.contains(url[0]) || url.toLowerCase().startsWith(AppConfig.schemePrefix)) { return openMatrixToUrl();