Merge pull request #219 from GetStream/hotfix/reaction-type

Reactions Hotfix
This commit is contained in:
Salvatore Giordano
2021-01-18 11:59:30 +01:00
committed by GitHub
3 changed files with 17 additions and 6 deletions
+4
View File
@@ -1,3 +1,7 @@
## 0.2.20+3
- Fix reaction picker score indicator
## 0.2.20+2
- Added `shouldAddChannel` to ChannelsBloc in order to check if a channel has to be added to the list when a new message arrives
+12 -5
View File
@@ -31,9 +31,17 @@ class ReactionPicker extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: reactionToEmoji.keys.map((reactionType) {
final ownReactionIndex = message.latestReactions
?.indexWhere((reaction) => reaction.type == reactionType) ??
var user = StreamChat.of(context).user;
final ownReactionIndex = message.latestReactions?.indexWhere(
(reaction) =>
reaction.type == reactionType &&
reaction.userId == user.id) ??
-1;
final totalScore = message.latestReactions
.where((r) => r.type == reactionType)
.map((r) => r.score)
.fold(0, (tot, s) => tot + s);
return Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
@@ -55,12 +63,11 @@ class ReactionPicker extends StatelessWidget {
}
},
),
ownReactionIndex != -1
totalScore > 0
? Padding(
padding: const EdgeInsets.only(bottom: 4.0),
child: Text(
message.latestReactions[ownReactionIndex].score
.toString(),
totalScore.toString(),
style: TextStyle(color: Colors.white),
),
)
+1 -1
View File
@@ -1,7 +1,7 @@
name: stream_chat_flutter
homepage: https://github.com/GetStream/stream-chat-flutter
description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter.
version: 0.2.20+2
version: 0.2.20+3
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues