Skip to content

Commit 9ed3999

Browse files
fix: 🐛Fixed timer not disposing when tapped on TooltipActionButton (#506) (#507)
1 parent 817e005 commit 9ed3999

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
- Fixed [#503](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/503) - Cursor
66
not changing to click mode when it is hovering over the clickable widgets provided by this
77
package.
8+
- Fixed [#506](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/506) - Timer
9+
was not canceling when tapped on `TooltipActionButton` which may cause issue when `autoPlay` is ON.
810

911
## [4.0.1]
1012
- Fixed [#493](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/493) - ShowCase.withWidget not showing issue

lib/src/showcase.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,9 @@ class _ShowcaseState extends State<Showcase> {
609609
Duration(seconds: showCaseWidgetState.autoPlayDelay.inSeconds),
610610
_nextIfAny);
611611
}
612+
} else if (timer?.isActive ?? false) {
613+
timer?.cancel();
614+
timer = null;
612615
}
613616
}
614617

@@ -651,6 +654,13 @@ class _ShowcaseState extends State<Showcase> {
651654
return widget.child;
652655
}
653656

657+
@override
658+
void dispose() {
659+
timer?.cancel();
660+
timer = null;
661+
super.dispose();
662+
}
663+
654664
void initRootWidget() {
655665
WidgetsBinding.instance.addPostFrameCallback((_) {
656666
if (!mounted) return;

0 commit comments

Comments
 (0)