From e952d350c54ebc9951cd3bc5b85adfdc8228455e Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Fri, 20 Nov 2020 18:10:23 +0530 Subject: [PATCH] fix: Stop animation before pop --- lib/src/reaction_picker.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/src/reaction_picker.dart b/lib/src/reaction_picker.dart index 1946e9ff..d661621e 100644 --- a/lib/src/reaction_picker.dart +++ b/lib/src/reaction_picker.dart @@ -119,17 +119,24 @@ class _ReactionPickerState extends State { } } + void pop() async { + for (var a in animations) { + a.stop(); + } + Navigator.of(context).pop(); + } + /// Add a reaction to the message void sendReaction(BuildContext context, String reactionType) { StreamChannel.of(context) .channel .sendReaction(widget.message, reactionType); - Navigator.of(context).pop(); + pop(); } /// Remove a reaction from the message void removeReaction(BuildContext context, Reaction reaction) { StreamChannel.of(context).channel.deleteReaction(widget.message, reaction); - Navigator.of(context).pop(); + pop(); } }