fix: Stop animation before pop

This commit is contained in:
Deven Joshi
2020-11-20 18:10:23 +05:30
parent c70c49d54d
commit e952d350c5
+9 -2
View File
@@ -119,17 +119,24 @@ class _ReactionPickerState extends State<ReactionPicker> {
} }
} }
void pop() async {
for (var a in animations) {
a.stop();
}
Navigator.of(context).pop();
}
/// Add a reaction to the message /// Add a reaction to the message
void sendReaction(BuildContext context, String reactionType) { void sendReaction(BuildContext context, String reactionType) {
StreamChannel.of(context) StreamChannel.of(context)
.channel .channel
.sendReaction(widget.message, reactionType); .sendReaction(widget.message, reactionType);
Navigator.of(context).pop(); pop();
} }
/// Remove a reaction from the message /// Remove a reaction from the message
void removeReaction(BuildContext context, Reaction reaction) { void removeReaction(BuildContext context, Reaction reaction) {
StreamChannel.of(context).channel.deleteReaction(widget.message, reaction); StreamChannel.of(context).channel.deleteReaction(widget.message, reaction);
Navigator.of(context).pop(); pop();
} }
} }