From 734a6956423c52c8617cff54f3f25a2166f0ce04 Mon Sep 17 00:00:00 2001 From: Sahil-Simform Date: Thu, 12 Dec 2024 14:32:30 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Fixed=20mounter=20issue?= =?UTF-8?q?=20inside=20the=20`=5FscrollIntoView`=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/showcase.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/src/showcase.dart b/lib/src/showcase.dart index ae9fad84..b9a0acf0 100644 --- a/lib/src/showcase.dart +++ b/lib/src/showcase.dart @@ -603,12 +603,14 @@ class _ShowcaseState extends State { void _scrollIntoView() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) async { + if (!mounted) return; setState(() => _isScrollRunning = true); await Scrollable.ensureVisible( widget.key.currentContext!, duration: showCaseWidgetState.widget.scrollDuration, alignment: widget.scrollAlignment, ); + if (!mounted) return; setState(() => _isScrollRunning = false); }); }