@@ -65,8 +65,10 @@ class _ReactionWidgetState extends State<ReactionWidget> {
65
65
66
66
@override
67
67
Widget build (BuildContext context) {
68
- //// Convert into set to remove reduntant values
68
+ //// Convert into set to remove redundant values
69
69
final reactionsSet = widget.reaction.reactions.toSet ();
70
+ final isGroupChat = widget.reaction.reactedUserIds.length > 2 ;
71
+
70
72
return Positioned (
71
73
bottom: 0 ,
72
74
right: widget.isMessageBySender && needToExtend ? 0 : null ,
@@ -103,12 +105,18 @@ class _ReactionWidgetState extends State<ReactionWidget> {
103
105
child: Row (
104
106
children: [
105
107
Text (
106
- reactionsSet.join (' ' ),
108
+ isGroupChat
109
+ ? reactionsSet.take (3 ).join (' ' )
110
+ : reactionsSet.join (' ' ),
107
111
style: TextStyle (
108
- fontSize: messageReactionConfig? .reactionSize ?? 13 ,
112
+ fontSize: isGroupChat
113
+ ? messageReactionConfig? .reactionSize ?? 13
114
+ : 13 ,
109
115
),
110
116
),
111
117
if ((chatController? .chatUsers.length ?? 0 ) > 1 ) ...[
118
+ /// when reaction user length is 3 or <3 && they all have
119
+ /// reacted with the same reaction this condition will be true
112
120
if (! (widget.reaction.reactedUserIds.length > 3 ) &&
113
121
! (reactionsSet.length > 1 ))
114
122
...List .generate (
@@ -124,6 +132,9 @@ class _ReactionWidgetState extends State<ReactionWidget> {
124
132
messageReactionConfig? .profileCircleRadius,
125
133
),
126
134
),
135
+
136
+ /// ReactionUser length > 3 && all have reacted with the same
137
+ /// reaction then this condition will be executed
127
138
if (widget.reaction.reactedUserIds.length > 3 &&
128
139
! (reactionsSet.length > 1 ))
129
140
Padding (
0 commit comments