From b31754d8d10034c8b6fd3030464954669ce3a12b Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Mon, 14 Jun 2021 17:23:39 +0200 Subject: [PATCH] little fix --- .../lib/src/stream_chat_theme.dart | 91 +++++++++---------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/stream_chat_theme.dart b/packages/stream_chat_flutter/lib/src/stream_chat_theme.dart index 981d8131..91ed2537 100644 --- a/packages/stream_chat_flutter/lib/src/stream_chat_theme.dart +++ b/packages/stream_chat_flutter/lib/src/stream_chat_theme.dart @@ -343,70 +343,69 @@ class StreamChatThemeData { reactionIcons: [ ReactionIcon( type: 'love', - builder: (context, highlighted, size) => StreamSvgIcon.loveReaction( - color: highlighted - ? colorTheme.accentBlue - : iconTheme.color!.withOpacity(.5), - size: size, - ), + builder: (context, highlighted, size) { + final theme = StreamChatTheme.of(context); + return StreamSvgIcon.loveReaction( + color: highlighted + ? theme.colorTheme.accentBlue + : theme.primaryIconTheme.color!.withOpacity(.5), + size: size, + ); + }, ), ReactionIcon( type: 'like', - builder: (context, highlighted, size) => - StreamSvgIcon.thumbsUpReaction( - color: highlighted - ? colorTheme.accentBlue - : iconTheme.color!.withOpacity(.5), - size: size, - ), + builder: (context, highlighted, size) { + final theme = StreamChatTheme.of(context); + return StreamSvgIcon.thumbsUpReaction( + color: highlighted + ? theme.colorTheme.accentBlue + : theme.primaryIconTheme.color!.withOpacity(.5), + size: size, + ); + }, ), ReactionIcon( type: 'sad', - builder: (context, highlighted, size) => - StreamSvgIcon.thumbsDownReaction( - color: highlighted - ? colorTheme.accentBlue - : iconTheme.color!.withOpacity(.5), - size: size, - ), + builder: (context, highlighted, size) { + final theme = StreamChatTheme.of(context); + return StreamSvgIcon.thumbsDownReaction( + color: highlighted + ? theme.colorTheme.accentBlue + : theme.primaryIconTheme.color!.withOpacity(.5), + size: size, + ); + }, ), ReactionIcon( type: 'haha', - builder: (context, highlighted, size) => StreamSvgIcon.lolReaction( - color: highlighted - ? colorTheme.accentBlue - : iconTheme.color!.withOpacity(.5), - size: size, - ), + builder: (context, highlighted, size) { + final theme = StreamChatTheme.of(context); + return StreamSvgIcon.lolReaction( + color: highlighted + ? theme.colorTheme.accentBlue + : theme.primaryIconTheme.color!.withOpacity(.5), + size: size, + ); + }, ), ReactionIcon( type: 'wow', - builder: (context, highlighted, size) => StreamSvgIcon.wutReaction( - color: highlighted - ? colorTheme.accentBlue - : iconTheme.color!.withOpacity(.5), - size: size, - ), + builder: (context, highlighted, size) { + final theme = StreamChatTheme.of(context); + return StreamSvgIcon.wutReaction( + color: highlighted + ? theme.colorTheme.accentBlue + : theme.primaryIconTheme.color!.withOpacity(.5), + size: size, + ); + }, ), ], ); } } -class ReactionTheme { - final double singleSize; - final double size; - final Color ownReactionColor; - final Color otherReactionColor; - - const ReactionTheme({ - required this.singleSize, - required this.size, - required this.ownReactionColor, - required this.otherReactionColor, - }); -} - /// Class for holding text theme class TextTheme { /// Initialise light text theme