Skip to content

Commit 756c26a

Browse files
committed
Fix Tile count not updating when Reaction row is updated
(maybe we should pass a randomValueKey when instancing instead?)
1 parent be74767 commit 756c26a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/flyer_chat_reactions/lib/src/widgets/reaction_tile.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ class _ReactionTileState extends State<ReactionTile> {
9999
_isTapped = widget.reactedByUser;
100100
}
101101

102+
@override
103+
void didUpdateWidget(ReactionTile oldWidget) {
104+
super.didUpdateWidget(oldWidget);
105+
if (oldWidget.count != widget.count) {
106+
setState(() {
107+
_count = widget.count;
108+
});
109+
}
110+
}
111+
102112
@override
103113
Widget build(BuildContext context) {
104114
// Used to shrink on state update

0 commit comments

Comments
 (0)