Skip to content

Commit 4d6d185

Browse files
committed
fix: 🐛Fixed timer not disposing when tapped on TooltipActionButton (#506)
1 parent ea99366 commit 4d6d185

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
@@ -2,6 +2,8 @@
22
- Feature [#500](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/500) -
33
Added `onDismiss` callback in `ShowCaseWidget` which will trigger whenever `onDismiss` method is
44
called
5+
- Fixed [#506](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/506) - Timer
6+
was not canceling when tapped on `TooltipActionButton` which may cause issue when `autoPlay` is ON
57

68
## [4.0.1]
79
- 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)