From e42ea6c46981bb6c20e71d7edbd50d4ff751df56 Mon Sep 17 00:00:00 2001 From: Sahil-Simform Date: Wed, 26 Feb 2025 11:37:41 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9BFixed=20timer=20not=20dispos?= =?UTF-8?q?ing=20when=20tapped=20on=20`TooltipActionButton`=20(#506)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ lib/src/showcase.dart | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c2dcbf3..5c2e9ba9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ - Fixed [#503](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/503) - Cursor not changing to click mode when it is hovering over the clickable widgets provided by this package. +- Fixed [#506](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/506) - Timer + was not canceling when tapped on `TooltipActionButton` which may cause issue when `autoPlay` is ON. ## [4.0.1] - Fixed [#493](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/493) - ShowCase.withWidget not showing issue diff --git a/lib/src/showcase.dart b/lib/src/showcase.dart index 236a51a3..e82b8dcb 100644 --- a/lib/src/showcase.dart +++ b/lib/src/showcase.dart @@ -609,6 +609,9 @@ class _ShowcaseState extends State { Duration(seconds: showCaseWidgetState.autoPlayDelay.inSeconds), _nextIfAny); } + } else if (timer?.isActive ?? false) { + timer?.cancel(); + timer = null; } } @@ -651,6 +654,13 @@ class _ShowcaseState extends State { return widget.child; } + @override + void dispose() { + timer?.cancel(); + timer = null; + super.dispose(); + } + void initRootWidget() { WidgetsBinding.instance.addPostFrameCallback((_) { if (!mounted) return;