@@ -284,6 +284,11 @@ class Showcase extends StatefulWidget {
284284 /// Default to [const TooltipActionConfig()]
285285 final TooltipActionConfig ? tooltipActionConfig;
286286
287+ /// Defines the alignment for the auto scroll function.
288+ ///
289+ /// Defaults to 0.5.
290+ final double scrollAlignment;
291+
287292 /// Highlights a specific widget on the screen with an informative tooltip.
288293 ///
289294 /// This widget helps you showcase specific parts of your UI by drawing an
@@ -344,6 +349,7 @@ class Showcase extends StatefulWidget {
344349 /// - `toolTipMargin` : The margin around the tooltip (defaults to 14dp).
345350 /// - `tooltipActions` : A list of custom actions (widgets) to display within the tooltip.
346351 /// - `tooltipActionConfig` : Configuration options for custom tooltip actions.
352+ /// - `scrollAlignment` : Defines the alignment for the auto scroll function.
347353 ///
348354 /// **Assertions:**
349355 ///
@@ -400,6 +406,7 @@ class Showcase extends StatefulWidget {
400406 this .toolTipMargin = 14 ,
401407 this .tooltipActions,
402408 this .tooltipActionConfig,
409+ this .scrollAlignment = 0.5 ,
403410 }) : height = null ,
404411 width = null ,
405412 container = null ,
@@ -494,6 +501,7 @@ class Showcase extends StatefulWidget {
494501 this .toolTipSlideEndDistance = 7 ,
495502 this .tooltipActions,
496503 this .tooltipActionConfig,
504+ this .scrollAlignment = 0.5 ,
497505 }) : showArrow = false ,
498506 onToolTipClick = null ,
499507 scaleAnimationDuration = const Duration (milliseconds: 300 ),
@@ -590,7 +598,7 @@ class _ShowcaseState extends State<Showcase> {
590598 await Scrollable .ensureVisible (
591599 widget.key.currentContext! ,
592600 duration: showCaseWidgetState.widget.scrollDuration,
593- alignment: 0.5 ,
601+ alignment: widget.scrollAlignment ,
594602 );
595603 setState (() => _isScrollRunning = false );
596604 });
0 commit comments