From f8780f831be80f82bf98ba33caa72b11f382f1cc Mon Sep 17 00:00:00 2001 From: Abdelrahman Saed Date: Mon, 26 Aug 2024 09:22:27 +0300 Subject: [PATCH] feat: add autoShow to showcase.dart --- lib/src/showcase.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/src/showcase.dart b/lib/src/showcase.dart index 1779f98b..0dbb706c 100644 --- a/lib/src/showcase.dart +++ b/lib/src/showcase.dart @@ -252,6 +252,9 @@ class Showcase extends StatefulWidget { /// Defaults to 7. final double toolTipSlideEndDistance; + /// if `autoShow` is true, showcase will be shown automatically + final bool autoShow; + const Showcase({ required this.key, required this.description, @@ -298,6 +301,7 @@ class Showcase extends StatefulWidget { this.onBarrierClick, this.disableBarrierInteraction = false, this.toolTipSlideEndDistance = 7, + this.autoShow = false, }) : height = null, width = null, container = null, @@ -339,6 +343,7 @@ class Showcase extends StatefulWidget { this.onBarrierClick, this.disableBarrierInteraction = false, this.toolTipSlideEndDistance = 7, + this.autoShow = false, }) : showArrow = false, onToolTipClick = null, scaleAnimationDuration = const Duration(milliseconds: 300), @@ -410,7 +415,7 @@ class _ShowcaseState extends State { void showOverlay() { final activeStep = ShowCaseWidget.activeTargetWidget(context); setState(() { - _showShowCase = activeStep == widget.key; + _showShowCase = activeStep == widget.key || widget.autoShow; }); if (activeStep == widget.key) {