@@ -289,6 +289,12 @@ class Showcase extends StatefulWidget {
289289 /// Defaults to 0.5.
290290 final double scrollAlignment;
291291
292+ /// While target widget is out viewport then
293+ /// whether enabling auto scroll so as to make the target widget visible.
294+ /// This is used to override the [ShowCaseWidget.enableAutoScroll] behaviour
295+ /// for this showcase.
296+ final bool ? enableAutoScroll;
297+
292298 /// Highlights a specific widget on the screen with an informative tooltip.
293299 ///
294300 /// This widget helps you showcase specific parts of your UI by drawing an
@@ -350,6 +356,7 @@ class Showcase extends StatefulWidget {
350356 /// - `tooltipActions` : A list of custom actions (widgets) to display within the tooltip.
351357 /// - `tooltipActionConfig` : Configuration options for custom tooltip actions.
352358 /// - `scrollAlignment` : Defines the alignment for the auto scroll function.
359+ /// - `enableAutoScroll` :This is used to override the [ShowCaseWidget.enableAutoScroll] behaviour for this showcase.
353360 ///
354361 /// **Assertions:**
355362 ///
@@ -407,6 +414,7 @@ class Showcase extends StatefulWidget {
407414 this .tooltipActions,
408415 this .tooltipActionConfig,
409416 this .scrollAlignment = 0.5 ,
417+ this .enableAutoScroll,
410418 }) : height = null ,
411419 width = null ,
412420 container = null ,
@@ -502,6 +510,7 @@ class Showcase extends StatefulWidget {
502510 this .tooltipActions,
503511 this .tooltipActionConfig,
504512 this .scrollAlignment = 0.5 ,
513+ this .enableAutoScroll,
505514 }) : showArrow = false ,
506515 onToolTipClick = null ,
507516 scaleAnimationDuration = const Duration (milliseconds: 300 ),
@@ -580,7 +589,7 @@ class _ShowcaseState extends State<Showcase> {
580589 });
581590
582591 if (activeStep == widget.key) {
583- if (showCaseWidgetState.enableAutoScroll) {
592+ if (widget.enableAutoScroll ?? showCaseWidgetState.enableAutoScroll) {
584593 _scrollIntoView ();
585594 }
586595
0 commit comments