Skip to content

Commit

Permalink
feat: ✨Provided alignment parameter to adjust the auto scroll alignme…
Browse files Browse the repository at this point in the history
…nt property (#478). (#482)

Co-authored-by: Vatsal Tanna <[email protected]>
  • Loading branch information
1 parent 8f0ac0a commit 772b28c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
- Feature ✨: Added Action widget for tooltip
- Feature [#475](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/475) - Add
feasibility to change margin of tooltip with `toolTipMargin`.
- Feature [#478](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/478) - Added
feasibility to change auto scroll widget alignment `scrollAlignment`.

## [3.0.0]
- [BREAKING] Fixed [#434](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/434) removed deprecated text style after Flutter 3.22 follow [migration guide](https://docs.flutter.dev/release/breaking-changes/3-19-deprecations#texttheme)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ WidgetsBinding.instance.addPostFrameCallback((_) =>
| toolTipMargin | double | 14 | For tooltip margin |
| globalTooltipActionConfig | TooltipActionConfig? | | Global tooltip actionbar config |
| globalTooltipActions | List<TooltipActionButton>? | | Global list of tooltip actions |
| scrollAlignment | double | 0.5 | For Auto scroll widget alignment |

## Properties of `Showcase` and `Showcase.withWidget`:

Expand Down
10 changes: 9 additions & 1 deletion lib/src/showcase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ class Showcase extends StatefulWidget {
/// Default to [const TooltipActionConfig()]
final TooltipActionConfig? tooltipActionConfig;

/// Defines the alignment for the auto scroll function.
///
/// Defaults to 0.5.
final double scrollAlignment;

/// Highlights a specific widget on the screen with an informative tooltip.
///
/// This widget helps you showcase specific parts of your UI by drawing an
Expand Down Expand Up @@ -344,6 +349,7 @@ class Showcase extends StatefulWidget {
/// - `toolTipMargin`: The margin around the tooltip (defaults to 14dp).
/// - `tooltipActions`: A list of custom actions (widgets) to display within the tooltip.
/// - `tooltipActionConfig`: Configuration options for custom tooltip actions.
/// - `scrollAlignment`: Defines the alignment for the auto scroll function.
///
/// **Assertions:**
///
Expand Down Expand Up @@ -400,6 +406,7 @@ class Showcase extends StatefulWidget {
this.toolTipMargin = 14,
this.tooltipActions,
this.tooltipActionConfig,
this.scrollAlignment = 0.5,
}) : height = null,
width = null,
container = null,
Expand Down Expand Up @@ -494,6 +501,7 @@ class Showcase extends StatefulWidget {
this.toolTipSlideEndDistance = 7,
this.tooltipActions,
this.tooltipActionConfig,
this.scrollAlignment = 0.5,
}) : showArrow = false,
onToolTipClick = null,
scaleAnimationDuration = const Duration(milliseconds: 300),
Expand Down Expand Up @@ -590,7 +598,7 @@ class _ShowcaseState extends State<Showcase> {
await Scrollable.ensureVisible(
widget.key.currentContext!,
duration: showCaseWidgetState.widget.scrollDuration,
alignment: 0.5,
alignment: widget.scrollAlignment,
);
setState(() => _isScrollRunning = false);
});
Expand Down

0 comments on commit 772b28c

Please sign in to comment.