Skip to content

Commit

Permalink
feat: add autoShow to showcase.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
binSaed committed Aug 26, 2024
1 parent a635729 commit f8780f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/src/showcase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -410,7 +415,7 @@ class _ShowcaseState extends State<Showcase> {
void showOverlay() {
final activeStep = ShowCaseWidget.activeTargetWidget(context);
setState(() {
_showShowCase = activeStep == widget.key;
_showShowCase = activeStep == widget.key || widget.autoShow;
});

if (activeStep == widget.key) {
Expand Down

0 comments on commit f8780f8

Please sign in to comment.