From 42daa48d325851b6f680bbadf531c467b823031b Mon Sep 17 00:00:00 2001 From: Sahil-Simform <122270155+Sahil-Simform@users.noreply.github.com> Date: Fri, 8 Mar 2024 15:48:57 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Added=20mounted=20check?= =?UTF-8?q?=20before=20`setState`=20in=20`=5FreverseAnimateTooltip`=20(#41?= =?UTF-8?q?1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added mounted check before `setState` in `_reverseAnimateTooltip` as this maybe called when widget is unmounted as this may be called when user taps very quickly and widget gets unmounted which throws error --- lib/src/showcase.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/src/showcase.dart b/lib/src/showcase.dart index cab1017d..b1b00cfd 100644 --- a/lib/src/showcase.dart +++ b/lib/src/showcase.dart @@ -510,6 +510,7 @@ class _ShowcaseState extends State { /// Reverse animates the provided tooltip or /// the custom container widget. Future _reverseAnimateTooltip() async { + if (!mounted) return; setState(() => _isTooltipDismissed = true); await Future.delayed(widget.scaleAnimationDuration); _isTooltipDismissed = false;