fix reaction picker score indicator
This commit is contained in:
@@ -37,6 +37,10 @@ class ReactionPicker extends StatelessWidget {
|
|||||||
reaction.type == reactionType &&
|
reaction.type == reactionType &&
|
||||||
reaction.userId == user.id) ??
|
reaction.userId == user.id) ??
|
||||||
-1;
|
-1;
|
||||||
|
final totalScore = message.latestReactions
|
||||||
|
.where((r) => r.type == reactionType)
|
||||||
|
.map((r) => r.score)
|
||||||
|
.reduce((tot, s) => tot + s);
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
@@ -58,12 +62,11 @@ class ReactionPicker extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ownReactionIndex != -1
|
totalScore > 0
|
||||||
? Padding(
|
? Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 4.0),
|
padding: const EdgeInsets.only(bottom: 4.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
message.latestReactions[ownReactionIndex].score
|
totalScore.toString(),
|
||||||
.toString(),
|
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user