diff --git a/lib/pages/chat/events/message_reactions.dart b/lib/pages/chat/events/message_reactions.dart index 7681c90ae..dede458aa 100644 --- a/lib/pages/chat/events/message_reactions.dart +++ b/lib/pages/chat/events/message_reactions.dart @@ -4,8 +4,6 @@ import 'package:collection/collection.dart' show IterableExtension; import 'package:matrix/matrix.dart'; import 'package:fluffychat/config/app_config.dart'; -import 'package:fluffychat/config/themes.dart'; -import 'package:fluffychat/utils/platform_infos.dart'; import 'package:fluffychat/widgets/avatar.dart'; import 'package:fluffychat/widgets/future_loading_dialog.dart'; import 'package:fluffychat/widgets/matrix.dart'; @@ -111,11 +109,7 @@ class _Reaction extends StatelessWidget { @override Widget build(BuildContext context) { final theme = Theme.of(context); - final textColor = - theme.brightness == Brightness.dark ? Colors.white : Colors.black; - final color = reacted == true - ? theme.bubbleColor - : theme.colorScheme.surfaceContainerHigh; + Widget content; if (reactionKey.startsWith('mxc://')) { content = Row( @@ -132,8 +126,9 @@ class _Reaction extends StatelessWidget { const SizedBox(width: 4), Text( count.toString(), + textAlign: TextAlign.center, style: TextStyle( - color: textColor, + color: theme.colorScheme.onSurface, fontSize: DefaultTextStyle.of(context).style.fontSize, ), ), @@ -148,7 +143,7 @@ class _Reaction extends StatelessWidget { content = Text( renderKey.toString() + (count > 1 ? ' $count' : ''), style: TextStyle( - color: reacted == true ? theme.onBubbleColor : textColor, + color: theme.colorScheme.onSurface, fontSize: DefaultTextStyle.of(context).style.fontSize, ), ); @@ -159,17 +154,18 @@ class _Reaction extends StatelessWidget { borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2), child: Container( decoration: BoxDecoration( - color: color, + color: reacted == true + ? theme.colorScheme.primaryContainer + : theme.colorScheme.surfaceContainerHigh, + border: Border.all( + color: reacted == true + ? theme.colorScheme.primary + : theme.colorScheme.surfaceContainerHigh, + width: 1, + ), borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2), ), - // #Pangea - // issue: https://github.com/pangeachat/client/issues/3100 - // fix: https://github.com/flutter/flutter/issues/119623#issuecomment-2476719745 - padding: PlatformInfos.isIOS - ? const EdgeInsets.fromLTRB(5.5, 1, 3, 2.5) - : const EdgeInsets.symmetric(horizontal: 4, vertical: 2), - // padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2), - // Pangea# + padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2), child: content, ), ); diff --git a/lib/pages/chat/events/pangea_message_reactions.dart b/lib/pages/chat/events/pangea_message_reactions.dart index 0150b63d4..8055dd308 100644 --- a/lib/pages/chat/events/pangea_message_reactions.dart +++ b/lib/pages/chat/events/pangea_message_reactions.dart @@ -7,7 +7,6 @@ import 'package:collection/collection.dart' show IterableExtension; import 'package:matrix/matrix.dart'; import 'package:fluffychat/config/app_config.dart'; -import 'package:fluffychat/config/themes.dart'; import 'package:fluffychat/pages/chat/chat.dart'; import 'package:fluffychat/pages/chat/events/emoji_burst.dart'; import 'package:fluffychat/pages/chat/events/reaction_listener.dart'; @@ -345,11 +344,6 @@ class _ReactionState extends State<_Reaction> with TickerProviderStateMixin { @override Widget build(BuildContext context) { final theme = Theme.of(context); - final textColor = - theme.brightness == Brightness.dark ? Colors.white : Colors.black; - final color = widget.reacted == true - ? theme.bubbleColor - : theme.colorScheme.surfaceContainerHigh; Widget content; if (widget.reactionKey.startsWith('mxc://')) { @@ -367,8 +361,9 @@ class _ReactionState extends State<_Reaction> with TickerProviderStateMixin { const SizedBox(width: 4), Text( widget.count.toString(), + textAlign: TextAlign.center, style: TextStyle( - color: textColor, + color: theme.colorScheme.onSurface, fontSize: DefaultTextStyle.of(context).style.fontSize, ), ), @@ -383,7 +378,7 @@ class _ReactionState extends State<_Reaction> with TickerProviderStateMixin { content = Text( renderKey.toString() + (widget.count > 1 ? ' ${widget.count}' : ''), style: TextStyle( - color: widget.reacted == true ? theme.onBubbleColor : textColor, + color: theme.colorScheme.onSurface, fontSize: DefaultTextStyle.of(context).style.fontSize, ), ); @@ -438,7 +433,16 @@ class _ReactionState extends State<_Reaction> with TickerProviderStateMixin { ), child: Container( decoration: BoxDecoration( - color: color, + color: widget.reacted == true + ? theme.colorScheme.primaryContainer + : theme.colorScheme.surfaceContainerHigh, + border: Border.all( + color: widget.reacted == true + ? theme.colorScheme.primary + : theme + .colorScheme.surfaceContainerHigh, + width: 1, + ), borderRadius: BorderRadius.circular( AppConfig.borderRadius / 2, ),