Skip to content

Commit

Permalink
fix: 🐛 Fixed mounter issue inside the _scrollIntoView function
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahil-Simform committed Dec 12, 2024
1 parent cf351c2 commit 734a695
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/src/showcase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -603,12 +603,14 @@ class _ShowcaseState extends State<Showcase> {

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);
});
}
Expand Down

0 comments on commit 734a695

Please sign in to comment.