Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🐛 Fixed timer not cancelling when tapped on TooltipActionButton (#506) #507

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions lib/src/showcase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,9 @@ class _ShowcaseState extends State<Showcase> {
Duration(seconds: showCaseWidgetState.autoPlayDelay.inSeconds),
_nextIfAny);
}
} else if (timer?.isActive ?? false) {
timer?.cancel();
timer = null;
}
}

Expand Down Expand Up @@ -651,6 +654,13 @@ class _ShowcaseState extends State<Showcase> {
return widget.child;
}

@override
void dispose() {
timer?.cancel();
timer = null;
super.dispose();
}

void initRootWidget() {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted) return;
Expand Down